Gossamer Forum
Home : General : Perl Programming :

New Line \n

Quote Reply
New Line \n
Hi,
I'm using the following sub to send an email and have a question about the new line "\n" in the message body.
The way it is written below gives me double line spacing. If I remove the "\n" I get single line spacing.
What I would like to know is - Do different mail applications interpret it in different ways?
For example, I'm using Thunderbird and it displays as I have mentioned above but will OE, Eudora, etc. layout the message in the same way?
Also, does everything between the <<MAIL_BODY; MAIL_BODY usually get displayed as it is layed out?
E.G without the "\n" every line is being displayed on a new line.
Could some explain how this works and the best method to use so all my users see the message layed out in the same way. (I don't want to use html in the message).
Thanks.
Simon.

sub {
require GT::Mail;
my $tags = GT::Template->tags;
# Create Message
my $msg= <<MAIL_BODY;
Line 1\n
Line 2\n
Line 3\n
Line 4\n
etc....
MAIL_BODY

my $to = "$tags->{email}";
my $from = "name\@domain.com";
my $sbj = "Subject";
# Send Message
GT::Mail->send (
'Content-type' => 'text/plain',
sendmail => $CFG->{db_mail_path},
to => $to,
from => $from,
subject => $sbj,
msg => $msg
) or die "Error: $GT::Mail::error";

#end of sub
}
Subject Author Views Date
Thread New Line \n jai 17577 Apr 27, 2005, 4:53 PM
Thread Re: [jai] New Line \n
Andy 16711 Apr 28, 2005, 1:45 AM
Thread Re: [Andy] New Line \n
jai 16783 Apr 28, 2005, 7:26 AM
Thread Re: [jai] New Line \n
Andy 16726 Apr 28, 2005, 7:34 AM
Thread Re: [Andy] New Line \n
jai 16773 Apr 28, 2005, 8:07 AM
Thread Re: [jai] New Line \n
Andy 16751 Apr 28, 2005, 8:12 AM
Thread Re: [Andy] New Line \n
jai 16762 Apr 29, 2005, 3:54 AM
Post Re: [jai] New Line \n
NamedRisk 16479 Apr 29, 2005, 4:33 AM
Thread Re: [jai] New Line \n
Andy 16726 Apr 29, 2005, 5:08 AM
Thread Re: [Andy] New Line \n
jai 16782 Apr 29, 2005, 6:01 AM
Post Re: [jai] New Line \n
Andy 16445 Apr 29, 2005, 6:29 AM