Jump to content
Larry Ullman's Book Forums

Chapter 10: Smtp Server On Windows


Recommended Posts

I'm hoping someone can help me out with this - I'm sure it's pretty basic (?), but I just cannot work it out by myself.

 

It all started with the sidebar on PHP mail() Dependencies (pg 297). I'm one of the unfortunate ones: Running Windows, my ISP requires authentication (username and password) therefore I cannot simply change the php.ini file to get the mail script (10.1) to work. (even though I tried it anyway and - of course - it didn't work. I got a Failed to connect to mailserver" error).

 

As suggested in the sidebar, I've downloaded a free windows SMTP server (http://www.softstack.com/freesmtp.html) unfortunately, the only help I've been able to find about how to use it refers to configuring outlook or other mail programs. Tried saving it where it default to and tried saving it to the XAMPP directory. No joy with either. I've had a good search through this forum and the previous one at DMCInsights, but can't find any related threads (using SMTP as the search term). Perhaps I've missunderstood what 'localhost' means in the context of a mailserver?

 

So I ditched the free SMTP server and had a go at using yahoo as SMTP for a workaround while get my head around this. But when I tried (using Yahoo Outgoing Mail Server (SMTP) - smtp.mail.yahoo.com (SSL enabled, port 995) I got the same sort of error message:

 

"Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.mail.yahoo.com" port 995, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\email.php on line 34"

 

I've tried both setting the php.ini file AND using ini_set code.

 

What's got me stumped is that both methods (php.ini and ini_set code) seem to know which mail server I'm trying to connect to and which port (as these are repeated in the error messages) but they just don't connect.

 

What am I missing?

 

 

Thanks in advance for any assistance!

Link to comment
Share on other sites

As far as I know, the mail function in PHP is very basic and not flexible. To do all that, you have to use the PEAR mail library, which should automatically be include in PHP 5.2 (I think) and above.

 

There was another post about this recently (perhaps on the e-commerce board) with some pretty thorough answers, so you may want to search around a bit.

 

Sorry I can't be of more help.

Link to comment
Share on other sites

As far as I know, the mail function in PHP is very basic and not flexible. To do all that, you have to use the PEAR mail library, which should automatically be include in PHP 5.2 (I think) and above.

 

There was another post about this recently (perhaps on the e-commerce board) with some pretty thorough answers, so you may want to search around a bit.

 

Sorry I can't be of more help.

 

Thanks for the tip! Much appreciated. I'll have a search for the other thread see if they can help me understand what's happening.

I ended up finally getting it to work using my ISP mailserver which appeared to use my ISP email address (which I don't normally use) as some sort of authenticator. It worked as long as I used that ISP address as the return address. Maybe some sort of anti-spam measure? Thanks again!

Link to comment
Share on other sites

Glad that's working for you. I think with ISPs, you can generally use their mail server without authentication if you're using the associated email address because the request is coming from inside the same network: i.e., a message sent from an @isp address from within the ISP's network is legit.

Link to comment
Share on other sites

 Share

×
×
  • Create New...