\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}\r\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n" . "Content-Transfer-Encoding: 7bit\r\n\r\n" . $message .= str_replace("This email was sent using Note2Self.\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 .= "\r\n\r\n--{$mime_boundary}\r\n" . "Content-Type: {$type}\r\n" . "Content-Disposition: attachment;" . " filename=\"{$name}\"\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n" . $data . "\r\n\r\n" . "--{$mime_boundary}--\r\n"; echo "0"; } mail($to, $subject, $message, $headers); ?>