Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old April 18th, 2008, 05:37 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 161
Default PHP ini file SMTP config is failing me left and right.

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!
Reply
  #2  
Old April 18th, 2008, 06:07 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 161
Default

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
Reply
  #3  
Old April 18th, 2008, 06:29 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 161
Default

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.
Reply
  #4  
Old October 1st, 2008, 10:47 AM
Newbie
 
Join Date: Oct 2008
Posts: 3
Default

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
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles