|
|
|
|
![]() ![]() |
Sep 16 2005, 02:10 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
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: 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 since the 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 have seen. Can't figure out what's going on. Thanks in advance for reading this and any suggestion or solutions. kvarnerexpress |
|
|
|
Sep 16 2005, 08:27 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 463 Joined: 8-November 04 Member No.: 2,186 |
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
|
|
|
|
Sep 16 2005, 10:46 PM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 518 Joined: 29-April 05 From: Canada Eh?!? Member No.: 6,408 |
What do you mean the mail function isn't on this server? I've sent mail using php from trap17.
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. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th October 2008 - 11:57 PM |