The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I've figured out how to send to Hotmail and get my images show, but not as attachments, using Mimetype (Mimes!), but they come out all wrong in Outlook - is there a special trick for doing this bad idea? Thanks.
This works both in thunderbird and outlook for me. At least if this doesn't work you can put it down to your client with more certainty.
$textemail="This is the text part of the message.\n";
$htmlemail="
Header
Paragraph
\n";$subject="Test Email";
$to="Test
$from="HTML Tester
$mime_boundary="==Multipart_Boundary_sjs48643ik";
$headers = "From: $from\n" .
"Reply-to: $from\n".
"X-Mailer: PHP Mail\n".
"MIME-Version: 1.0\n" .
"Content-Type:multipart/alternative;\n" .
" boundary=\"".$mime_boundary."\"\n";
$message = "This is a multi-part message in MIME format.\n\n" .
"--".$mime_boundary."\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$textemail .
"--".$mime_boundary."\n" .
"Content-Type: text/html; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$htmlemail;
if (mail($to, $subject, $message, $headers))
echo "Email Sent!";
else
echo "Failed to send message.";
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
They are the headers to the plain text part, and show up in Outlook with the plain text message. The boundaries blatantly work because they successfully split the message up into it's alternative parts.
This is really annoying now, as it'll start holding up a couple of projects if it carries on much longer. The message source is fine, and as far as I can tell the rest of it is fine. But it refuses to work.
BUT!!!
I've had HTML emails forwarded to me that have worked in someone else's Outlook, and the headers, boundaries, etc. work in exactly the same way, but these messages haven't displayed as HTML in my Outlook either. It's set to HTML. Hate to admit it, but I'm stumped.
EDIT: Nah, still nothing doing. I built the headers up as you suggested, but it looks exactly the same in the message source. The problem lies when it's detecting the boundary for the plain text, but it's no different from the countless other examples I've seen.
What I'd be tempted to do especially with the headers is rather than relying on 1 big multi-line string to put it all the information together is build it up line by line yourself and making sure you've got the correct number of linefeeds and spaces. eg
$headers = "From: $from\n";
$headers.= "MIME-Version: 1.0\n";
..and so on. Email clients are generally very unforgiving when it comes to parsing emails, an extra "\n" or a "\r" where it shouldn't be and it'll fall to pieces.
It could well be your email client thats the problem here too, but I guess that theory is easily tested.
--==MXCVS_73849576_REGIONFREE_NANU-NANU==
Content-Type: text/plain; charset=" . '"' . "iso-8859-1" . '"' . "
Content-Transfer-Encoding: 7bit
plain text content
--==MXCVS_73849576_REGIONFREE_NANU-NANU==
Content-Type: text/html; charset=" . '"' . "iso-8859-1" . '"' . "
Content-Transfer-Encoding: 7bit
HTML text content
--==MXCVS_73849576_REGIONFREE_NANU-NANU==--"
mail("$this_email", "$subject", "$message",
"Date: $page_date, $page_time \n" .
"Return-Path: Newsletter
"From: Newsletter
"Organization: Muh \n" .
"X-Mailer: PHP 4.3.11 \n" .
"MIME-Version: 1.0 \n" .
"Content-Type: multipart/alternative; boundary=" . '"' . "==MXCVS_73849576_REGIONFREE_NANU-NANU==" . '"' . " \n\n");
I'm sure it's not the code. Although that means that it probably is.