Monks, the code works fine. When i get the input from the user for $text, i want to get the input with multiple lines. If the user gives enter after typing first line, the code starts running, i want to get the input even if the user gives enter key until he gives ctrl+c or ctrl+D or ctrl+z or some other option. How can i achieve this. Because in text part i want to print multiple lines. I tried by making input record separator undef, but it is not working as per my requirement

use Mail::Sender::Easy qw(email); print "Enter the From address with comma separator\n"; chomp ($from = <STDIN>); print "Enter the To address with comma separator\n"; chomp ($to = <STDIN>); print "Enter the cc address with comma separator\n"; chomp ($cc = <STDIN>); print "Enter the bcc address with comma separator\n"; chomp ($bcc = <STDIN>); print "Enter the subject\n"; chomp ($sub = <STDIN>); print "Enter the body part\n"; chomp ($text = <STDIN>); email({ 'from' => "$from", 'to' => "$to", 'cc' => "$cc", 'bcc' => "$bcc", 'subject' => "$sub", 'priority' => 2, # 1-5 high to low 'confirm' => 'delivery, reading', 'smtp' => '192.168.1.5', 'port' => 25, #'auth' => 'LOGIN', #'authid' => 'foo@bar.baz', 'authpwd' => 'protect_with_700_perms_or_get_it_from_input +', '_text' => "$text" }) or die "email() failed: $@";

In reply to <STDIN> input by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.