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
}
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
}