sudheer157 has asked for the wisdom of the Perl Monks concerning the following question:
my $mime_msg = MIME::Lite->new( From => $from_user, To => $to_users, Bcc => $bcc_users, Cc => $cc_users, Subject => $subject, Type => "multipart/related") or die "Error creating MIME bod +y: $!\n"; my $body='/tmp/file.txt' $mime_msg->attach(Type => 'text/html', Path => $body, Filename => $bod +y ) or die "Error attaching html: $!\n"; $smtp->data(); $smtp->datasend($message_body); $smtp->dataend(); #close connection $smtp->quit();
=== file1.txt ==
Line one
line two
line three
I am able to send an email but the body of the email is not as expected. the new lines are stripped out.
===== Mail body ===
Line one line two line three
I am wondering hot to get the mail body as is in the file1.txt ie line breaks are missing. I am not sure why perl is not considering the new line chars as line breaks. Appreciate you help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME Lite no line feed in Message body
by Corion (Patriarch) on Jun 26, 2011 at 11:54 UTC | |
by sudheer157 (Initiate) on Jun 26, 2011 at 12:10 UTC | |
by derby (Abbot) on Jun 26, 2011 at 12:20 UTC | |
by ww (Archbishop) on Jun 26, 2011 at 13:12 UTC | |
by sudheer157 (Initiate) on Jun 27, 2011 at 12:07 UTC | |
by Anonymous Monk on Jun 27, 2011 at 12:19 UTC | |
by sudheer157 (Initiate) on Jun 27, 2011 at 15:09 UTC | |
|