http://www.perlmonks.org?node_id=689060


in reply to Send mail with attachment using only SMTP

there is an attachment, but it is almost empty, unreadable file

If you look at the raw mail message, does it look like you would expect?

$smtp->datasend("Content-type: multipart/mixed; boundary=\"frontier\"\n");

Is that line wrap after multipart/mixed; just an artifact of cut-n-pasting, or is that in your actual code like this? (hint: the Content-type header should be one line)

___

(BTW, if you closed your code tags like this </code>, you wouldn't have the problem with [$_] being turned into links... :)