Page 1 of 1

Uhhhmmm I've never seen this before

Posted: Mon Mar 22, 2004 4:54 pm
by magicrobotmonkey
I'm trying to throw together a quick mime e-mail script. This is what I am trying to do:

Code: Select all

<?php
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "To: Aaron Bassett <cmlbassett@hotmail.com>\n";
$headers .= "From: Alfred Barrett <abassett@cml-1885.com>\n";
$headers .= "Reply-To: Alfred Barrett <abassett@cml-1885.com>\n";
$headers .= "Subject: Just Checking... \n";
$headers .= "Content-Type: multipart/alternative;\n boundary="text_boundary"\n";
$headers .= "--text_boundary\n";
$headers .= "Content-Type: text/plain; charset = "iso-8859-1"\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "I just want to see if this's working! \n";
$headers .= "--text_boundary\n";
$headers .= "Content-Type: text/html; charset="iso-8859-1"\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "<bold>Is this bold? </bold> or not?\n";
$headers .= "--text_boundary\n--";

echo $headers;

 mail("cmlbassett@hotmail.com, abassett@cml-1885.com", "", "",$headers);
?>

It was working then all of a sudden I started getting The Page cannot be found error in my browser. Locally or remotely, its like the php file just disappeared? And here's the weirdest part, I tried throwing it in a page that was working that has like three or four diff. php files all included and it loads partway, up to the part where its about to echo $headers, then disappears and the error comes up! I don't even know how that can happen!!?! But if I comment out the mail line, it works fine? ANy ideas?

Posted: Mon Mar 22, 2004 4:58 pm
by magicrobotmonkey
Wait! I changed this:
mail("cmlbassett@hotmail.com, abassett@cml-1885.com", "", "",$headers);
to this:
mail("cmlbassett@hotmail.com, abassett@cml-1885.com", "", "r",$headers);
and now I can at least find the page. But all that shows up in the body of the email is "r"

Posted: Mon Mar 22, 2004 6:28 pm
by Illusionist
thats because thats what you sending in the body of the message...

Posted: Mon Mar 22, 2004 6:31 pm
by magicrobotmonkey
well how do I use the mail function then? and why all the page not found craziness?

Posted: Mon Mar 22, 2004 6:34 pm
by Illusionist
i have no idea about the page not found stuff. [php_man]mail()[/php_man] will provide you with information on using the mail() function.