\r\n"; /* else $headers = "From: $from\r\n"; */ $headers .= "Return-Path: $from\r\n"; $headers .= "Reply-To: $from\r\n"; if ($size == 0) { $message = 'A recent Note2Self was not successfully uploaded, please check your iPhone and resubmit the note.'; error_log('vm_send_iphone_debug: zero byte notes ' . $to . ' From ' . $from); echo "9"; } else { $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/mixed;\r\n boundary=\"{$mime_boundary}\""; // next, we'll build the message body // note that we insert two dashes in front of the // MIME boundary when we use it $message = "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message .= str_replace("This email was sent using Note2Self on the iPhone.\r\n", '', $messageContent); // now we'll insert a boundary to indicate we're starting the attachment // we have to specify the content type, file name, and disposition as // an attachment, then add the file content and set another boundary to // indicate that the end of the file has been reached $message .= "\n\n--{$mime_boundary}\n" . "Content-Type: {$type}\n" . "Content-Disposition: attachment;" . " filename=\"{$name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; echo "0"; } mail($to, $subject, $message, $headers); ?>