Problems sending Html Mail on *NIX server
Posted: Fri May 09, 2003 9:43 pm
I have been having great problems using the mail() function on my develoment WIN2K server and now i have it working, when I transfered to script to my ISP's production server it does not work. Basically the html message seems to be snarling it up I dont understand why. Can you help. this is a section of the script.
I have already tried messing with \r\n and putting the $message var in single quotes.
The development machine is:
WIN2K
PHP 4.3.1
Apache 1.3.27
The Production machine is:
FreeBSD 4.6.2
PHP 4.2.3
Apache 1.3.27
Can you help? I really dont have a clue on this one.
Code: Select all
$myname = "Touch Support";
$myemail = "support@touch.com";
$contactname = "$uforename $usurname";
$contactemail = "$uemail";
$myreplyemail = "support@touch.com";
if ($mymail == ""){$suppemail = "";}
else
{
$suppname = "$myforename $mysurname";
$suppemail = "$mymail";
$suppemail2 = ",$mymail";
}
if (semail == ""){$engmail = "";}
else
{
$engname = "$sforename $ssurname";
$engmail = "$semail";
$engmail2 = ",$semail";
}
$allmail = "$contactemail $suppemail2 $engmail2 ,$myemail";
$subject = "Job No $job_id has been created";
$message .= (" <HTML>
<BODY>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
.................
a whole load of html in between
..............................
</BODY></HTML> ");
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$myname." <".$myemail.">\r\n";
$headers .= "To: ".$contactname." <".$contactemail.">,".$suppname." <".$suppemail.">,".$engname." <".$engmail.">, ".$myname." <".$myemail.">\r\n";
$headers .= "Reply-To: ".$myname." <".$myreplyemail.">\r\n";
$headers .= "X-Mailer: Touch Support Server\r\n";
$headers .= "x-message-flag: Touch Support\r\n";
mail( $allmail, $subject, $message, $headers);The development machine is:
WIN2K
PHP 4.3.1
Apache 1.3.27
The Production machine is:
FreeBSD 4.6.2
PHP 4.2.3
Apache 1.3.27
Can you help? I really dont have a clue on this one.