Connecting Tech Pros Worldwide Help | Site Map

PHP ini file SMTP config is failing me left and right.

Familiar Sight
 
Join Date: Sep 2007
Posts: 164
#1: Apr 18 '08
Okay, I have been searching all morning, and have found nothing on how to solve this, I hope I am to be posting this thread under IIS vs. PHP forum. Sorry if its in the wrong spot.

So here is my SMTP section of my php.ini
-------------------------------------------------------------------------
[mail function]
; For Win32 only.
SMTP = mail.website.com
smtp_port = 25

; For Win32 only.
sendmail_from = name@website.com
-----------------------------------------------------------------------

When I try and submit my form, which I know works, I get this error on my page:

[PHP]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 C:\Websites\TRR DNN\sendmail.php on line 95

Warning: Cannot modify header information - headers already sent by (output started at C:\Websites\TRR DNN\sendmail.php:95) in C:\Websites\TRR DNN\sendmail.php on line 96[/PHP]


What I dont understand is why it is saying there is any error at "localhost" when it should be looking for mail.website.com

I have ensured the php.ini file is saved, I have bounced IIS (6, on Windows Server 2003) by the way. Rebooted and everything.

The email server is NOT on this machine, and I CAN to a:
telnet website.com 25
from this machine.

I am juuust out of ideas. Any PHP, mail, IIS peeps that can help me out there that would be GREAT!
Familiar Sight
 
Join Date: Sep 2007
Posts: 164
#2: Apr 18 '08

re: PHP ini file SMTP config is failing me left and right.


UPDATE:

When checking the config with the phpinfo page I have notice something weird?

The config path for the php.ini, according to this page is set to
C:\WINDOWS

when it is indeed set to C:\php

Just an update, thought it might help?

Another update,
The loaded config file says NONE
Familiar Sight
 
Join Date: Sep 2007
Posts: 164
#3: Apr 18 '08

re: PHP ini file SMTP config is failing me left and right.


Sorry for posting like a mad man! I solved the problem, but I don't know why this was happening.

Like I said, when I ran the phpinfo page it told me it was looking for the ini file in C:\WINDOWS. I don't know where it got that value from??? I had IIS set to look in C:\php and environment variables, and everything else. SO I just dumped the files from the php directory into the WINDOWS directory, and changed everything accordingly and now it works.

I still don't have an answer for why it was looking in the windows directory, I have installed PHP on an identical setup before without this problem. SO I just thought Id follow up in case anyone else runs into this same case.

Good Luck.
Newbie
 
Join Date: Oct 2008
Posts: 3
#4: Oct 1 '08

re: PHP ini file SMTP config is failing me left and right.


You might also want to try the mMail library found here:

http://www.virtualthinking.com/loadhtml.php?where=scripts&what=art_show.php&db_ta rget=00000000023
Reply