Q Posted July 30, 2009 Share Posted July 30, 2009 Hi guys.. I've been banging my head against a wall the last two weeks. I simply can't get IIS Mail server to relay mails from my php scripts on the same server. I've been googling and tried everything I can imagine could help. Changing the smtp server in php.ini to all kinds of different settings, adding the sendmail_from, and still nothing. A weird thing though is that the mail function does not return any errors, not matter what I do. I've turned error reporting on in all different ways possible. Please, someone.. Bring me the magic cure! Edit: Just found out the mails is put in the C:\Inetpub\mailroot\queue folder, but never sent? Why is that? Quote Link to comment https://forums.phpfreaks.com/topic/168088-solved-php-mail-function-not-sending-mails-nor-returning-errormessages/ Share on other sites More sharing options...
Q Posted July 30, 2009 Author Share Posted July 30, 2009 This is what the log contains: #Software: Microsoft Internet Information Services 6.0 #Version: 1.0 #Date: 2009-07-30 06:08:06 #Fields: time c-ip cs-method cs-uri-stem sc-status 06:08:06 10.128.0.196 HELO - 250 06:08:06 10.128.0.196 MAIL - 250 06:08:06 10.128.0.196 RCPT - 250 06:08:06 10.128.0.196 DATA - 250 06:08:06 10.128.0.196 QUIT - 240 Quote Link to comment https://forums.phpfreaks.com/topic/168088-solved-php-mail-function-not-sending-mails-nor-returning-errormessages/#findComment-886582 Share on other sites More sharing options...
Q Posted July 31, 2009 Author Share Posted July 31, 2009 No one's got anything? Quote Link to comment https://forums.phpfreaks.com/topic/168088-solved-php-mail-function-not-sending-mails-nor-returning-errormessages/#findComment-887361 Share on other sites More sharing options...
BMurtagh Posted July 31, 2009 Share Posted July 31, 2009 Hi Q, The 250 status messages of look to be successful ones according to the Microsoft (http://support.microsoft.com/?id=256321) documentation as well as looking up SMTP status codes. Have you attempted to add PHP's error reporting to your code to hopefully see if there's an underlying issue? ini_set("display_errors", "1"); error_reporting(E_ALL); Another suggestion to confirm of the IIS SMTP service is working correctly would be to try using a simple ASP script that sends from the local SMTP to an address. As another side note, have you attempted to connect locally/remotely to the SMTP server using telnet? Hop on the server and type: telnet mail.domain.com(or IP of the SMTP server) 25 This can be done locally or remotely and it should reply with a 220 status code meaning the service is ready. Quote Link to comment https://forums.phpfreaks.com/topic/168088-solved-php-mail-function-not-sending-mails-nor-returning-errormessages/#findComment-887744 Share on other sites More sharing options...
PFMaBiSmAd Posted July 31, 2009 Share Posted July 31, 2009 If the messages are appearing in the mail server queue, it means that the mail server has accepted them from the php script. The mail() function would not return an error under this condition. A TRUE value from the mail() function only means that there is a sending mail server and that it accepted the email. After that point, your issue is somewhere within the mail server. You should probably give the administrator of the mail server an email you are trying to send in order to find out why it is not being sent. Can you send an email through the mail server using an email client, like Outlook, or using a web based interface? Quote Link to comment https://forums.phpfreaks.com/topic/168088-solved-php-mail-function-not-sending-mails-nor-returning-errormessages/#findComment-887759 Share on other sites More sharing options...
Q Posted July 31, 2009 Author Share Posted July 31, 2009 Hi guys! - Thank you very much for the answers.. I have tried to turn error handling on in PHP, and there is no underlying errors - I'll try the other things monday morning! - Again.. Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/168088-solved-php-mail-function-not-sending-mails-nor-returning-errormessages/#findComment-887843 Share on other sites More sharing options...
Q Posted August 4, 2009 Author Share Posted August 4, 2009 Okay.. Everything looks like it's supposed to on my end. I've given the task to the server administrator. Thanks for the help guys! Quote Link to comment https://forums.phpfreaks.com/topic/168088-solved-php-mail-function-not-sending-mails-nor-returning-errormessages/#findComment-890326 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.