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();
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |