$smtp->datasend("Content-type: multipart/mixed; boundary=\"frontier\"\n"); # needs to be all on one line or like this: $smtp->datasend("Content-type: multipart/mixed; boundary=\"frontier\"\n");