ashonline Posted January 16, 2007 Share Posted January 16, 2007 HiI am currently updating a PHP-based website on a Windows 2003 web server. Everything seems to work ok except for a form which sends an email via an Exchange SMTP server on another server machine.This worked ok when the website was on a server with an old version of PHP (3.something). It was talking to the same SMTP server which hasn't changed.Web Server:Windows 2003 SP1IIS 6.0PHP 5.2.0.0The code snippet is as follows. It always executes the "else" statement.[code]$From = $_REQUEST['from'];$Subject = "White Papers Website Response";$Body = "New User Registration \nName : " . $title . " " . $firstname . "\n" . $lastname . "\nCompany : " . $company . "\nIndustry: " . $industry . "\nEmail : " . $email . "\nPhone : " . $phone;$To = "[email protected]"; //$_REQUEST['sendto']; if (mail($To, $Subject, $Body, "From: " . $From . "\n X-Mailer: PHP/" . "Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n" . phpversion() ) ){ setcookie("registered", "true", time()+31536000); header("Location: white_papers.php"); } else{ $email_error = true; }[/code]Can someone please assist? Any help much appreciated!ThanksAsh Link to comment https://forums.phpfreaks.com/topic/34375-mail-cant-send-via-smtp/ Share on other sites More sharing options...
Hypnos Posted January 16, 2007 Share Posted January 16, 2007 Your old php.ini file must of been configured for your mail server. If you still have a copy of it, you can use it as a reference when editing the new php.ini file.Search for "SMTP". Link to comment https://forums.phpfreaks.com/topic/34375-mail-cant-send-via-smtp/#findComment-161792 Share on other sites More sharing options...
ashonline Posted January 17, 2007 Author Share Posted January 17, 2007 Unfortunately i don't have access to the old PHP installation - the server machine was upgraded from Win2000/PHP3 to Win2003/PHP5.The php.ini file has the following lines:SMTP = pa01smtp_port = 25sendmail_from = [email protected]Exchange is on the 'pa01' server.I believe the issue does lie with the PHP installation as opposed to the code as the website works fine on my personal Fedora/PHP5 server. Link to comment https://forums.phpfreaks.com/topic/34375-mail-cant-send-via-smtp/#findComment-162620 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.