vennirajan has asked for the wisdom of the Perl Monks concerning the following question:
I am facing issues while sending mail using Mail::Mailer module.I need a way to send body containing multiple lines using the Mail::Mailer module. Hope you people might have faced this issue at any of your tasks which used Mail::Mailer. The requirement is, I have to read the contents from a file and need to send the file contents as the body message to the mail.
The problem here is, when i send the mail, the body contains only the first line of the file. The remaining contents are not available in the body part. But, if i replace the newline characters from the file contents with the string '<br>', the remaining contents are coming properly.
I need your valuable suggestions for,
Thanks for your valuable time.my $mailer = new Mail::Mailer 'smtp', Server => 'localhost' or die "Co +uldn't create a mail object!\n"; my $mail_headers = { 'Content-Type' => 'text/plain', #I tried with 'text/html' for html + body. But that one was also failed :( To => [ $to ], From => 'root@mydomain.com', Subject => $subject, }; $mailer->open( $mail_headers ); $mailer->print($mailContents); #$mailContents - Contains the file cont +ents with new lines. $mailer->close();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to send mail containing multiple lines using Mail::Mailer?
by whereiskurt (Friar) on Mar 14, 2007 at 13:28 UTC | |
Re: How to send mail containing multiple lines using Mail::Mailer?
by hangon (Deacon) on Mar 14, 2007 at 10:58 UTC | |
by vennirajan (Friar) on Mar 14, 2007 at 11:46 UTC | |
Re: How to send mail containing multiple lines using Mail::Mailer?
by shmem (Chancellor) on Mar 14, 2007 at 11:05 UTC | |
by davorg (Chancellor) on Mar 14, 2007 at 11:09 UTC | |
by vennirajan (Friar) on Mar 14, 2007 at 11:47 UTC | |
Re: How to send mail containing multiple lines using Mail::Mailer?
by chargrill (Parson) on Mar 14, 2007 at 17:37 UTC |