kvarnerexpress 0 Report post Posted September 16, 2005 I'm trying to send an attachment using the mail Php function.It gets caught by the email server with an error. It seems to have a problem with the separator or who knows what. The server says something like "invalid separator on mime type."The code is:Code: // subject $subject = "Hello There "; $mime_boundary = "<<<--==-->>>"; // headers $headers = "From: " . 'Tom' . " <" . 'texample@aol.com' . ">\r\n"; $headers .= "Return-Path: " . 'texample@aol.com' . "\r\n"; $headers .= "Reply-To: " . 'texample@aol.com' . "\r\n"; $headers .= "Content-type: Multipart/Mixed;\r\n"; $headers .= "Mime-Version: 1.0\r\n"; $headers .= "X-Mailer: PHP Mailer\r\n"; $headers .= " boundary=\"".$mime_boundary."\""; // message $message .= "This is a multi-part message in MIME format.\r\n"; $message .= "\r\n"; $message .= $mime_boundary."\r\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; $message .= "Content-Transfer-Encoding: 7bit\r\n"; $message .= "\r\n"; $message = "Attached is the file "; $message .= "."; $message .= "\n\n"; $message .= $mime_boundary."\r\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n"; $message .= " name=\"feedback.txt\"\r\n"; $message .= "Content-Description: Requested File;\r\n"; $message .= " filename=\"feedback.txt\"\r\n"; $message .= "\r\n"; $message .= $mime_boundary."\r\n"; $email = "dianne@aol.com"; // Send if (mail ($email, $subject, $message, $headers)) { echo "<script>alert ('Your email was sent. ')</script>"; } else { echo "<script>alert ('Unable to send your email.')</script>"; } I'm not trying to use the MimeMail class or anything sincethe version of Php that we're using is not supported by it.I'm just trying to do this using the mail function.The code seems o.k. when compared to others that I haveseen. Can't figure out what's going on.Thanks in advance for reading this and any suggestion orsolutions. kvarnerexpress Share this post Link to post Share on other sites
round 0 Report post Posted September 16, 2005 asking a very stupid question but does the sever actually allow you to use mail functions, cause this one doesn't. I mean i have tons of scripts that i've used that work like a charm but you should look to php.net and see if there's anything there that will answer you question or fix your problem.round Share this post Link to post Share on other sites
moldboy 0 Report post Posted September 16, 2005 What do you mean the mail function isn't on this server? I've sent mail using php from Xisto.Anyway about your question, yes php.net, but more specificaly try:http://ca3.php.net/manual/en/function.mail.php scroll down to the part where the users post Vladimir has posted a message that may pertain to you. Share this post Link to post Share on other sites