![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Attaching file and sending text in body using sendmail command!! | sparan_peddu | Shell Programming and Scripting | 1 | 03-24-2008 12:01 PM |
| AIX send mail with HTML message body and a binary attachment | G-Man | UNIX for Dummies Questions & Answers | 4 | 03-22-2007 10:15 AM |
| sending mails with attachment and also some text in mail body | guptan | UNIX for Advanced & Expert Users | 7 | 05-25-2006 03:17 AM |
| How can I write a HTML file in UNIX and sent it as a body of a mail | diwa81 | Shell Programming and Scripting | 0 | 10-13-2004 06:07 PM |
| How to get åäö in e-mail message body | de98luto | UNIX for Dummies Questions & Answers | 4 | 07-10-2002 02:35 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
perl/mail - inserting file text in message body
I've got the following code
sub mail_report { $Mailer = '/usr/sbin/sendmail joe@somewhere.net'; open MAIL,"|$Mailer"; print MAIL "Subject: $X connection attempt \n"; open MESSAGE, "<$outdir$X"; print MESSAGE '$outdir$X\n'; close MESSAGE; close MAIL; } #End sub mail_report where I would like to insert text from a file as the body of the message at the line print MESSAGE '$outdir$X\n'; The message is received OK however the text is not inserted into the body of the message. Could someone point out the error of my ways? Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
Code:
sub mail_report {
$Mailer = '/usr/sbin/sendmail joe@somewhere.net';
open MAIL,"|$Mailer";
print MAIL "Subject: $X connection attempt \n\n";#two newlines after subject
open(MESSAGE, "<", "$outdir$X") or die "$!";
print MAIL <MESSAGE>;
close MESSAGE;
close MAIL;
} #End sub mail_report
|
|
|||
|
Quote:
That fixed the problem. thumper |
|||
| Google UNIX.COM |