Click here to get back home

[MIME::Lite] not recognizing carriage-returns in body of message

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
[MIME::Lite] not recognizing carriage-returns in body of message Richard A. Melia 08-18-2005
Posted by Richard A. Melia on August 18, 2005, 5:06 pm
Please log in for more thread options


I am using MIME::Lite to send an e-mail with a file attachment.
Everything works well except for the body of the message.
I am using Type => 'TEXT' and Data => $comment
Where $comment has embedded carriage-returns (\n).
When the message arrives, it is one long string displaying all the \n's that
were embedded.
Can anyone tell me what to do to fix this problem?
Thanks in advance.




Posted by Sisyphus on August 19, 2005, 1:49 pm
Please log in for more thread options



> I am using MIME::Lite to send an e-mail with a file attachment.
> Everything works well except for the body of the message.
> I am using Type => 'TEXT' and Data => $comment
> Where $comment has embedded carriage-returns (\n).
> When the message arrives, it is one long string displaying all the \n's
that
> were embedded.
> Can anyone tell me what to do to fix this problem?

The following fits your description:

use warnings;
$comment1 = "This is a comment.\nIt is intended to appear over 2 lines\n";
$comment2 = 'This is a comment.\nIt is intended to appear over 2 lines\n';
print $comment1, "\n", $comment2, "\n";
__END__

The solution in this case is (obviously) to assign in *double* quotes, not
in *single* quotes.

Cheers,
Rob




Posted by Richard A. Melia on August 23, 2005, 3:47 pm
Please log in for more thread options


Rob:

Many thanks - your solution did the trick.
It was so obvious I don't know how I missed it, too focused I guess.

Thanks again,

Richard

>
>> I am using MIME::Lite to send an e-mail with a file attachment.
>> Everything works well except for the body of the message.
>> I am using Type => 'TEXT' and Data => $comment
>> Where $comment has embedded carriage-returns (\n).
>> When the message arrives, it is one long string displaying all the \n's
> that
>> were embedded.
>> Can anyone tell me what to do to fix this problem?
>
> The following fits your description:
>
> use warnings;
> $comment1 = "This is a comment.\nIt is intended to appear over 2 lines\n";
> $comment2 = 'This is a comment.\nIt is intended to appear over 2 lines\n';
> print $comment1, "\n", $comment2, "\n";
> __END__
>
> The solution in this case is (obviously) to assign in *double* quotes, not
> in *single* quotes.
>
> Cheers,
> Rob
>
>




Similar ThreadsPosted
MIME::Parser .. how to get just the message part of the body September 7, 2005, 10:28 am
how to display html in email message body with mime:: entity July 11, 2004, 10:45 pm
SOAP::LITE Can't read entity body July 1, 2005, 5:34 pm
How to log the output of Mime::Lite ? June 26, 2006, 6:52 pm
Perl Mime::Lite question. Help please? August 24, 2004, 8:45 am
MIME::Lite need sendmail Queue ID November 16, 2006, 9:34 am
Having trouble installing MIME::Lite module July 6, 2006, 4:25 pm
SOAP::Lite WSDL method with multiple soap:body parts February 16, 2005, 3:32 pm
XML::XSLT not recognizing attributes January 14, 2005, 2:08 pm
SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring November 5, 2004, 8:45 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap