ID: 15373 Comment by: jeff at jouster dot org Reported By: alonso at admintek dot net Status: No Feedback Bug Type: Mail related Operating System: win2000 PHP Version: 4.2.1 Assigned To: mfischer New Comment:
I have this same problem. I have Windows Server 2003 SP2 IIS 6. PHP6-dev (also same problem with 5.4) Port 25 is open and I can telnet to the server from my home machine completely outside the network and manually send an email. So I know that SMTP is not the problem and relaying is not a problem. Here's my script: <?php $success = mail("[EMAIL PROTECTED]", "subject", "body", "From: My Name <[EMAIL PROTECTED]>"); echo ($success); if ($success) { echo (" success!"); } else { echo (" problem..."); } ?> When I run this test script I see: 1 success! However I never get an email. I have php.ini set to log errors (have also tried display errors) and there is never any errors logged or displayed. php.ini SMTP section: [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = [EMAIL PROTECTED] phpinfo() shows all of this information properly (only after I moved the .ini file into the PHP install directory. I have PHPRC environment variable set to PHP install directory and have added same directory to my PATH env var. Mail was successfully being sent until another issue caused me to uninstall and reinstall the SMTP Service portion of IIS. I see no solutions or cause to this problem in this thread. Any new news? Original issue was posted 6 years ago... I can't believe this is still cropping up for people. Previous Comments: ------------------------------------------------------------------------ [2008-07-10 15:47:04] phpseven at yahoo dot com smtp server can't run. i tried my best to solve it but it can't send the mail. ------------------------------------------------------------------------ [2007-10-25 11:13:44] vvel3000 at yahoo dot co dot in Warning: mail() [function.mail]: Failed to connect to mailserver at "mail.yourisp.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\1.php on line 7 There was an error why so you error ------------------------------------------------------------------------ [2007-09-17 18:06:22] johan dot jv at gmail dot com Hello guys, I see that you are having a lot of problem in sending email and some of you might not even been receiving any emails. Couple of things that you might need to check before sending any emails. 1- Anti-virus (make sure that the antivirus is not blocking port 25) 2- Your firewall, make sure that your fire wall are not blocking port 25, also make sure that you have your SMTP anable to receive email, you can set that up in your Firewall - Start - Settings- Network Connections - Advanced tab - Setting - exceptions "if you SMTP is not there, click Add Port , on the name field you can write (SMTP TCP) and under port type 25, then hit ok. do that again but with the same port and name but with UDP. 3 - REALLY IMPORTANT. if you are behind a router , you ISP might blocked 25 or you might just need to forward port 25 from your router seetings "portforward dot com/" 4- If you want to know if your port 25 is open or available go to this website canyouseeme dot org and on the field type 25 that will tell you if your port is active. ------- Something else you might try. -==if you don't know if your SMTP is working or install, Click Start - Setting - Control panel - add & Remove program - on the left side click Add / Remove Window Components - under the Windows Components Wizard you can see Internet Information Services (IIS) Click that and then Click DETAIL (it's on the right side) after that you can see a list of the IIS Server, Click or Check the SMTP Server __""""Window might ask you for Window XP or your OS CD to install does files"""" make sure you have that on hand if you want to do this step. Then say okay. Restart your Apache server or you IIS server if you have one, then try to send your email again..... It might work.....doesn't hurt to try. :) Good Luck ------------------------------------------------------------------------ [2007-07-08 16:50:50] kivin_kong at hotmail dot com i have windows server 2003 R2 with IIS and php 5.2.3 and the mail() function ain't working the i use my ISP DNS server and not workin don't know what to do can someone help it is a recruitment form trying to send it to my email [EMAIL PROTECTED] ------------------------------------------------------------------------ [2006-10-05 05:15:04] bigredraddish at hotmail dot com XP PRO SP2 PHP 5.1.6 This is the error Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\www\htdocs\sendmail.php on line 43 this is line 43 of my php mail script mail("[EMAIL PROTECTED]", $subject, $message, $from); This is my PHP.INI [mail function] ; For Win32 only. SMTP = smtp.dodo.com.au ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15373 -- Edit this bug report at http://bugs.php.net/?id=15373&edit=1