salve con il seguente codice (non tutto ovviamente) invio email con un allegato un pdf generato con fpdf. quello che non funziona è l'invio del testo nel body dell'email. in sostanza arriva solo l'allegato. dove lo devo inserire e come?
grazie
//$to = "email@gmail.com";
$from = "info@psdxhtml.it";
$subject = "Preventivo sito ";
$message = "Salve in allegato potrà vedere la nostra miglior offerta per la realizzazione del vostro progetto.";
$separator = md5(time());
$eol = PHP_EOL;
$filename = "preventivo.pdf";
$pdfdoc = $pdf->Output("", "S");
$attachment = chunk_split(base64_encode($pdfdoc));
$headers = "From: ".$from.$eol;
$headers .= "MIME-Version: 1.0".$eol;
$headers .= "Content-Type: multipart/mixed;boundary=\"".$separator."\"".$eol.$eol;
$headers .= "Content-Transfer-Encoding: 7bit".$eol;
$body_top .= "Content-description: Mail message body\n\n";
$headers .= $message.$eol.$eol;
$headers .= "This is a MIME encoded message.".$eol.$eol;
$headers .= "--".$separator.$eol;
$headers .= "Content-Type: application/octet-stream;name=\"".$filename."\"".$eol;
$headers .= "Content-Transfer-Encoding: base64".$eol;
$headers .= "Content-Disposition: attachment".$eol.$eol;
$headers .= $attachment.$eol.$eol;
$headers .= "--".$separator."--";
mail($to, $subject, "", $headers);
mail("webmaster@supportoweb.it", $subject, $message, $headers);