#!/usr/bin/perl my $sendmail = "/usr/bin/sendmail -t"; my $reply_to = "Reply-to: bozo\n"; my $subject = "Subject: Put the subject here\n"; my $to = "To: myself\@mydomain.com\n"; open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!"; print SENDMAIL $to; print SENDMAIL $subject; print SENDMAIL "Content-type: text/plain\n\n"; print SENDMAIL `cat /the/file/i/want/to/send`; close(SENDMAIL);
In reply to how to attach file in sendmail by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |