PHP mail() Function Failing
Hi,
I have been unable to figure out why PHP's mail() function is not working for me. I am able to send emails using VB Script on the same box. I have configured IIS and SMTP on this Windows XP Pro box. Note: This example is given on the official manual (website php.net) of PHP: Code:
<?php Here is the VB Script that works fine for me on the same box: Code:
Set objMessage = CreateObject("CDO.Message") Code:
<?php Since the project is PHP based, I need to employ mail() to get the work (sending email alerts) done. Please Note: IIS and SMTP are working fine as the VB Script code given above is able to send emails. I am not sending emails to any outside network. It is for the LAN / Intranet only. I have used mail() several times before and it always worked. On this box it is not working. What could I be missing? My php.ini settings look like this: Code:
[mail function] |
Hi there,
Quote:
Can you establish a telnet session to port 25 on localhost? If yes, do you see the greeting message of an SMTP server? Does your SMTP require authentication (which PHP's mail() doesn't support)? Quote:
Quote:
Quote:
Doesn't IIS have any logging mechanism? It might be very helpful to have a log of the SMTP dialog. [X] Doc CPU |
Quote:
Here it is: Code:
http://php.net/manual/en/function.mail.php I have used the HTML version several times before but on a different box and LAN. No PHP mail() is working for me on this box. telnet to localhost : I did it now but it does not seem to work. I tried both: telnet localhost 587 and telnet localhost 25 on the command line as well as with Hyper Terminal. On the command prompt it reports: Code:
C:\>telnet localhost The IIS log says: Code:
#Software: Microsoft Internet Information Services 5.1 |
Hi there,
Quote:
Quote:
Code:
telnet localhost 25 Quote:
Are you sure the SMTP server of IIS is really set up correctly? The telnet probing looks like it's not. Quote:
[X] Doc CPU |
I changed the php.ini and set "SMTP = myCompany'sSMTPserverName" but initially it did not work. I then checked certain services such as RPC and found them stopped. I restarted those stopped services this emails went across.
So, since then I have been using the same SMTP Server. But just now I changed the value to "localhost" to see if the local SMTP is working now. But it is not. I am not sure what could be wrong with the SMTP on this local box. I re-installed it a couple of times. So, the local SMTP is the culprit. I am not sure how to set it right. |
All times are GMT -5. The time now is 12:12 AM. |