in reply to 'pre-MIMEing' an attachment?

I read the MIME RFC for a little something I'm working
on ( I should really start working on it again :-).
I think this really cheap code will help you:
use MIME::Base64; $smtp->data(); $smtp->datasend( "\nSubject: $subj \nMIME-Version: 1.0" ); $smtp->datasend( "\nContent-Type: multipart/mixed;boundary=\"Bb0uNddAr +ray\"" ); $smtp->datasend( "\n--Bb0uNddArray" ); $smtp->datasend( "\nContent-type: text/plain" ); $smtp->datasend( "\n\n$msg\n\n" ); # plaintext body if( $attachement ) { $smtp->datasend( "--Bb0uNddArray" ); $smtp->datasend( "\nContent-Type: $content_type; name=\"$filename\" +" ); $smtp->datasend( "\nContent-Transfer-Encoding: base64\n\n" ); while ( read( $file, $buff, 512 ) { $smtp->datasend( encode_base64($buff) ) || die"cant encode: $!"; } } # if attachement $smtp->datasend( "\n\n--Bb0uNddArray--" ); # send this even if ther +es no attachment $smtp->dataend(); $smtp->quit;
This is untested,
$smtp is a Net::SMTP handle

Hope it helps
-bl0rf