Hi,
I have a flat text file that I am reading into an array to use as the body of an e-mail:
I have some tags in this file that I am merging data from a database with which is why I have it as an external file.
When I output the array in my sendmail function, the text wraps a little weird. Here is the function...
The output basically wraps around, indenting each paragraph with one blank space like so..
It's odd that it does this because I have no spaces at the beginning of paragraphs as it is showing up.
Any ideas on how I can get rid of the blank?
Thanks.
-Tyler
I have a flat text file that I am reading into an array to use as the body of an e-mail:
Code:
$bodyfile = 'bodyofemail';
open(BODY, "$bodyfile") || die ("$bodyfile $!\n");
@bodyin = (<BODY>);
close(BODY);
I have some tags in this file that I am merging data from a database with which is why I have it as an external file.
When I output the array in my sendmail function, the text wraps a little weird. Here is the function...
Code:
sub sendTheMail(@)
{
#mailto = email address
#mailbody = body of the email
my ($mailto, $mailbody) = @_;
open (MAIL, '| /usr/lib/sendmail -t -oi');
print MAIL <<EOF;
TO: $mailto
FROM: $mailfrom
Subject: $mailsubj
@$mailbody #Array reference because it was passed to the function
EOF
close MAIL;
}
The output basically wraps around, indenting each paragraph with one blank space like so..
Code:
Hi, this is some text. This line will be very long to show you what it looks like here on this page. This line will be very long to show you what it looks like here on this page. This line will be very long to show you what it looks like here on this page. This line will be very long to show you what it looks like here on this page.
Even short lines get indented.
Even short lines get indented.
Even short lines get indented.
This is paragraph two. This line will also be very long to show you what it looks like here on this page. This line will also be very long to show you what it looks like here on this page.
It's odd that it does this because I have no spaces at the beginning of paragraphs as it is showing up.
Any ideas on how I can get rid of the blank?
Thanks.
-Tyler