The key is in the MIME header You need to include these two Content-Type: multipart/mixed; boundary="---some arbitrary text --" Then uuencode the attachment and append it to the end of the message with the boundary text as a separator between it and the actual message. --------------------------------------------------