mfali has asked for the wisdom of the Perl Monks concerning the following question:
I am a newbie to perl and have been facing issue when sending email via my perl script. The script I have generates a list of patches failing to meet some specific criteria. The list of patches is printed and placed at the output directory of the apache server.
My job requires me to send this list as an email to my co-workers. I am using the code below for this purpose
sub email_report{ my $subject='Excluded checkins after lockdown mode' ; my $mail='xxx@yyy.com'; open MAIL,">/home/mfali/Workscripts/tmpfile.html" || die $!; print MAIL "From:zzz@vvv.com\n"; print MAIL "To: $mail\n"; print MAIL "Subject: $subject\n"; print MAIL "Mime-Version: 1.0\n"; print MAIL "Content-Type:text/html\n"; open REPORT, "/home/mfali/public_html/my_report1/out.html" || die $!; while (<REPORT>) { print MAIL $_ ; } close REPORT; close MAIL; # Send the email system("/usr/lib/sendmail -t -oi < /home/mfali/Workscripts/tmpfile.h +tml"); }
When I look at the format of the patches either in the apache output directory or if I look the tmpfile.html , then the format looks correct. But when the same list comes through email, it's format is getting corrupted. I have been trying to resolve this issue for the past 2-3 days and have not been successful. I am not allowed to install any modules and either have to use the core modules or use sendmail. Can some one please suggest me as to how can i effectively send a report in the email keeping its format intact.
Using thunderbird mail client, with perl, v5.6.1 built for i686-linux.
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Email format issue
by wind (Priest) on Apr 18, 2011 at 07:44 UTC | |
by mfali (Initiate) on Apr 18, 2011 at 09:27 UTC | |
|
Re: Email format issue
by Corion (Patriarch) on Apr 18, 2011 at 07:42 UTC | |
|
Re: Email format issue
by jwkrahn (Abbot) on Apr 18, 2011 at 11:11 UTC | |
|
Re: Email format issue
by Xilman (Hermit) on Apr 18, 2011 at 07:41 UTC |