Jump to content

[SOLVED] php mail function not sending mails, nor returning errormessages


Recommended Posts

Hi guys.. I've been banging my head against a wall :facewall: 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?

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

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.

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?

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.