det er vel meningen $strHeader skal sendes ikk ??, du sender $headers
du mangler at sætte Content-Type: multipart/mixed, med deraf følgende headers;
jeg ville prøve noget a la dette (utested)
- <?php
- //*** Uniqid Session ***//
- $strSid = md5(uniqid(time()));
-
- // æøå
- $to = $_POST['mail'];
- $subject = 'the subject';
- $message = 'hello';
-
- $headers = 'From: min@gmail.com' . "\r\n" .
- 'Reply-To: min@gmail.com' . "\r\n";
- $headers .= "MIME-Version: 1.0\n";
- $headers .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\n\n";
- $headers .= "This is a multi-part message in MIME format.\n";
- $headers .= "--".$strSid."\n";
- $headers .= "Content-type: text/html; charset=utf-8\n";
- $headers .= "Content-Transfer-Encoding: 7bit\n\n";
- $headers .= $message."\n\n";
-
- //copy the temp. uploaded file to uploads folder
- $path_of_uploaded_file = $images . $name_of_uploaded_file;
- $tmp_path = $_FILES["uploaded_file"]["tmp_name"];
- if(is_uploaded_file($tmp_path)){
- if(!copy($tmp_path,$path_of_uploaded_file)) {
- $errors .= '\n error while copying the uploaded file';
- }
- }
- if($_FILES["fileAttach"]["name"] != "") {
- $strFilesName = $_FILES["upfile"]["name"];
- $strContent = chunk_split(base64_encode(file_get_contents($_FILES["upfile"]["tmp_name"])));
- $headers .= "--".$strSid."\n";
- $headers .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"\n";
- $headers .= "Content-Transfer-Encoding: base64\n";
- $headers .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"\n\n";
- $headers .= $strContent."\n\n";
- }
- mail($to, $subject, null, $headers);
- ?>
læg mærke til at kaldet i mail() også er lavet om, da message kommer som en del af headers
Indlæg senest redigeret d. 20.09.2012 17:15 af Bruger #16075