tapu ho fatto col tuo esmepio ecco il codice:
Codice PHP:
$to=trim($_REQUEST["To"]);
$from=trim($_REQUEST["From"]);
$subject=trim($_REQUEST["Subject"]);
$text=trim($_REQUEST["text"]);
$titolo=$_FILES["Attachment"]["name"];
$f=$_FILES["Attachment"]["tmp_name"];
$filetype=$_FILES["Attachment"]["type"];
$intestazioni = "From: $from\nReply-To: $reply\nX-Mailer: Sismail Web Email Interface\nMIME-version: 1.0\nContent-type: multipart/related;\n boundary=\"Message-Boundary\"\nContent-transfer-encoding: 7BIT\nX-attachments: $titolo";
$filez = fopen($f, "r");
$contents = fread($filez, filesize($f));
$encoded_attach = chunk_split(base64_encode($contents));
fclose($filez);
$msg_body .= "\n\n--Message-Boundary\n";
$msg_body .= "Content-ID: miaimmagine";
$msg_body .= "Content-type: $filetype; name=\"$titolo\"\n";
$msg_body .= "Content-Transfer-Encoding: BASE64\n";
$msg_body .= "Content-disposition: attachment; filename=\"$titolo\"\n\n";
$msg_body .= "$encoded_attach\n";
$body_top .= "Content-type: text/html; charset=iso-8859-1\n";
$body_top .= "Content-transfer-encoding: 7-BIT\n";
$body_top .= "Content-description: Mail message body\n\n";
$body_top .= "\n\n--Message-Boundary\n";
$body_top .= "Content-type: text/html; charset=iso-8859-1\n";
$body_top .= "Content-transfer-encoding: 7-BIT\n";
$body_top .= "Content-description: Mail message body\n\n";
$body_top .= $text ;
if(mail($to,$subject,$body_top,$intestazioni)) {
...
ma mi invia una email sena allegato e senza body