You need to download the perl modules listed below and copy the code to a
perl program.

use MIME::QuotedPrint;
use MIME::Base64;
use Mail::Sendmail 0.75; # doesn't work with v. 0.74!

%mail = (
        SMTP => 'smtp.site1.csi.com',
        from => '[EMAIL PROTECTED]',
        to => '[EMAIL PROTECTED]',
        subject => 'Test attachment',
        );
        

$boundary = "====" . time() . "====";
$mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";

$message = encode_qp( "Voil� le fichier demand�" );

$file = $^X; # This is the perl executable

open (F, $file) or die "Cannot read $file: $!";
binmode F; undef $/;
$mail{body} = encode_base64(<F>);
close F;

$boundary = '--'.$boundary;
$mail{body} = <<END_OF_BODY;
$boundary
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

$message
$boundary
Content-Type: application/octet-stream; name="$^X"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="$^X"

$mail{body}
$boundary--
END_OF_BODY

sendmail(%mail) || print "Error: $Mail::Sendmail::error\n";


-----Original Message-----
From: Anthony E. [mailto:apwebdesign@;yahoo.com]
Sent: Friday, November 08, 2002 12:38 PM
To: [EMAIL PROTECTED]
Subject: sending an email attachment


hello,

i need to write a program that will send an email with
some text in it as the body, and also have a word
document attached to it.

any suggestions on a module to do this?



__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to