Problems with mail() and Win2K
Posted: Mon Mar 17, 2003 5:30 pm
I am have a problem using the PHP mail function. First of, if I have no destination in the mail function I get a message saying "Bad Mail Address". If I enter a valid email address the PHP session hangs and I have to close the browser down and start again.PHP is running on Win2K with Apache and I know I have the correct setting for SMTP and sendmail_from. There is no value for sendmail_path (as using Win2K) and I can not find where you would set the SMTP port number, but I think in default it is correct at 25. Please find following code.
This problem is only on my production server. Using my ISP's Linux server there is no problem.
Any Ideas
Code: Select all
$myname = "Touch Support";
$myemail = "support@touch.com";
$contactname = "$uforename $usurname";
$contactemail = "$uemail";
$myreplyemail = "support@touch.com";
$suppname = "$myforename $mysurname";
$suppemail = "$mymail";
$engname = "$sforename $ssurname";
$engmail = "$semail";
$message = "Job No: $job_id has been created\n<br>";
$message .= "Date and time created: $action_time\n<br>";
$subject = "Job No $job_id has been created";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: ".$myname."<".$myemail.">\r\n";
$headers .= "To: ".$contactname."<".$contactemail.">\r\n";
$headers .= "cc: ".$myname."<".$myemail.">, ".$suppname."<".$suppemail.">, ".$engname."<".$engmail.">\r\n";
$headers .= "Reply-To: ".$myname."<".$myreplyemail.">r\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: Touch server\n";
//following is offeding line
mail("", $subject, $message, $headers);
//if I put an email address in the mail function PHP stops
mail($contactemail, $subject, $message, $headers);Any Ideas