Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Any help is welcome, and if my post here is wrong, pls tell me were I should post.sub emailFile { my $to = shift; my $subject = shift; my $content = shift; my $filename = shift; my $nette_naam = shift; my $command = "|/usr/lib/sendmail -f $from $to"; open(MAIL, $command) || die("Can't open sendmail!!\n"); print MAIL "To: $to\r\n"; print MAIL "Subject: $subject\r\n"; print MAIL "MIME-Version: 1.0\r\n"; print MAIL "Content-Type: multipart/mixed; boundary=\"----=_NextPa +rt_000_002C_01C2C170.A5EE7000\"\r\n"; print MAIL "\r\n"; print MAIL "This is a multi-part message in MIME format.\r\n"; print MAIL "\r\n"; print MAIL "------=_NextPart_000_002C_01C2C170.A5EE7000\r\n"; print MAIL "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; print MAIL "Content-Transfer-Encoding: 8bit\r\n"; print MAIL "\r\n"; print MAIL $content . today() . "\r\n"; print MAIL "\r\n"; if (open(FILE, $filename)) { print MAIL "------=_NextPart_000_002C_01C2C170.A5EE7000\r\n"; print MAIL "Content-Type: application/octet-stream; name=\"$ne +tte_naam\"\r\n"; print MAIL "Content-Transfer-Encoding: 8bit\r\n"; print MAIL "Content-Disposition: attachment; filename=\"$nette +_naam\"\r\n"; print MAIL "\r\n"; while (<FILE>) { print MAIL $_; } close (FILE); } print MAIL "------=_NextPart_000_002C_01C2C170.A5EE7000--\r\n"; print MAIL "\r\n"; close(MAIL); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mail distorted
by rdfield (Priest) on Nov 12, 2003 at 09:38 UTC | |
|
Re: Mail distorted
by cleverett (Friar) on Nov 12, 2003 at 10:32 UTC | |
|
Re: Mail distorted
by Anonymous Monk on Nov 12, 2003 at 11:53 UTC | |
|
Re: Mail distorted
by iburrell (Chaplain) on Nov 13, 2003 at 19:58 UTC | |
|
Re: Mail distorted
by Paulster2 (Priest) on Nov 12, 2003 at 19:02 UTC |