Hello People!
I am trying to order an email with attached archive, but the picture does not appear in the body of the email.
This is my code... So... If somebody can help me... contact me!
<?
$boundary = "----=NextPart_000" . uniqid("SO_PHP");
$file = "foto.jpg";
//text
$fg_message = "--$boundary\n";
$fg_message .= "Content-Type: text/plain; \n\tcharset=\"iso-8859-1\"\r\n";
$fg_message .= "Content-Transfer-Encoding: 7bit\r\n";
$fg_message .= "\$message\r\n";
// image
$fg_message .= "--$boundary\r\n";
$fg_message .= "Content-Type: image/jpg; name=$file\r\n";
$fg_message .= "Content-Transfer-Encoding: base64\r\n";
$fg_message .= "Content-Disposition: attachment; filename=$file\r\n";
$fg_message .= "\r\n--$boundary--";
//recipient
$fg_recipient = "$friend <$to>";
$fg_headers = "From: $name <$from>\r\n";
$fg_headers .= "X-Sender: $friend <$to>\r\n";
$fg_headers .= "Return-Path: <sati@wol.com.br>\r\n";
$fg_headers .= "MIME-Version: 1.0\n";
$fg_headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\r\n";
mail($fg_recipient, $subject, $fg_message, $fg_headers);
?>