$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"); #### my $body = .... my $attach = .... # base 64 encoded data my $a_name = ..... my $email =<datasend($email) $smtp->dataend() $smtp->quit;