Free SMTP server problem with PHP

bitt3n

Senior member
Dec 27, 2004
202
0
76
I tried using "Free SMTP Server" to send mail via PHP on my XP desktop machine, using localhost and port 25 in php.ini as suggested in the program, but it won't work. The same PHP code sends the mail fine if I upload it to a web server. I am using ZoneAlarm and gave "Free SMTP Server" server permission. The status bar in the "Free SMTP Server" program says "Waiting for connections on port #25; using DNS server: 199.166.28.10" (not my IP address). Any suggestions would be greatly appreciated. Thanks!
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
What's this "Free SMTP Server" you're talking about? Is it a windows smtp app? Let's have all the details about your network and what's running on your machine.

I'd be whipping out ethereal and finding some way to make the smtp traffic not go through localhost (on windows anyways) so that I could actually see it.
 

bitt3n

Senior member
Dec 27, 2004
202
0
76
yep it's a windows smtp app: http://www.softstack.com/freesmtp.html

my XP SP2 box is hooked up through a linksys router and I use zone alarm as a firewall. I've been told that need a local SMTP server because my ISP requires authentication to use its SMTP server, which is why I tried Free SMTP. I am just learning PHP so it is quite possible I am doing something stupid.

I have no familiarity with ethereal. I'll google it and see what I can learn about it.
 

bob4432

Lifer
Sep 6, 2003
11,726
45
91
in my case my isp block inbound port 25, but allows my stuff outbound on port 25, likely yours does to. the way i set up stuff is just put in my smtp outbound mail from the isp for php items, and since my cable modem's mac address is accepted by my isp, it allows 25 to flow out from any item on my lan.

in my php.ini i have the smtp stuff listed as:
[mail function]
; For Win32 only.
SMTP = smtp.west.cox.net
smtp_port = 25

basically, just use the same smtp info that you use for outlook express when setting up email.

hope this helps, i have taken some meds and am not making a lot of sense, sorry :confused:
 

Runes911

Golden Member
Dec 6, 2000
1,683
0
76
Originally posted by: bitt3n
yep it's a windows smtp app: http://www.softstack.com/freesmtp.html

my XP SP2 box is hooked up through a linksys router and I use zone alarm as a firewall. I've been told that need a local SMTP server because my ISP requires authentication to use its SMTP server, which is why I tried Free SMTP. I am just learning PHP so it is quite possible I am doing something stupid.

I have no familiarity with ethereal. I'll google it and see what I can learn about it.

I don't know what ISP you have but if you are using Cox they block port 25 outgoing. I am forced to use their mail server to send my mail, even though I pay for my own email service through another company.
 

bob4432

Lifer
Sep 6, 2003
11,726
45
91
Originally posted by: Runes911
Originally posted by: bitt3n
yep it's a windows smtp app: http://www.softstack.com/freesmtp.html

my XP SP2 box is hooked up through a linksys router and I use zone alarm as a firewall. I've been told that need a local SMTP server because my ISP requires authentication to use its SMTP server, which is why I tried Free SMTP. I am just learning PHP so it is quite possible I am doing something stupid.

I have no familiarity with ethereal. I'll google it and see what I can learn about it.

I don't know what ISP you have but if you are using Cox they block port 25 outgoing. I am forced to use their mail server to send my mail, even though I pay for my own email service through another company.

they block in unless it goes to their smtp server.....
 

bitt3n

Senior member
Dec 27, 2004
202
0
76
well, this is very strange..

I closed "Free SMTP Server" and changed the smtp server in php.ini to smtp.comcast.net, and when I tried the script, I got the error "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()."

I used the 'PHP info' function to check the php.ini filepath and verify that I was editing the right php.ini file, and I was. Why is it still talking about localhost then? Anyway, I then added

ini_set (SMTP, 'smtp.comcast.net');

to my php code, and the e-mail sent fine. So at least that works. I then tried SMTP = 'smtp.comcast.net' in my php.ini file (with single quotes, even though localhost wasn't in quotes), but that didn't help.

so the good news is I got it to work. however can anyone think why it won't work when I change the setting in php.ini? thanks

 

bob4432

Lifer
Sep 6, 2003
11,726
45
91
Originally posted by: bitt3n
well, this is very strange..

I closed "Free SMTP Server" and changed the smtp server in php.ini to smtp.comcast.net, and when I tried the script, I got the error "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()."

I used the 'PHP info' function to check the php.ini filepath and verify that I was editing the right php.ini file, and I was. Why is it still talking about localhost then? Anyway, I then added

ini_set (SMTP, 'smtp.comcast.net');

to my php code, and the e-mail sent fine. So at least that works. I then tried SMTP = 'smtp.comcast.net' in my php.ini file (with single quotes, even though localhost wasn't in quotes), but that didn't help.

so the good news is I got it to work. however can anyone think why it won't work when I change the setting in php.ini? thanks

maybe take off the quotes completely. the part i listed is exactly as it is from my php.ini fle
 

bitt3n

Senior member
Dec 27, 2004
202
0
76
yeah that's how I had it originally.. what's in there now is:

[mail function]
; For Win32 only.
SMTP = smtp.comcast.net
smtp_port = 25

but phpinfo() shows both local and master values of SMTP are still localhost.

I am definitely editing the right php.ini file. I've checked the filepath several times now.
 

bob4432

Lifer
Sep 6, 2003
11,726
45
91
Originally posted by: bitt3n
yeah that's how I had it originally.. what's in there now is:

[mail function]
; For Win32 only.
SMTP = smtp.comcast.net
smtp_port = 25

but phpinfo() shows both local and master values of SMTP are still localhost.

I am definitely editing the right php.ini file. I've checked the filepath several times now.

have you restarted the machine? or apache? maybe it is like in apache how you can config the config file, but it doesn't change until you restart apache.
 

bitt3n

Senior member
Dec 27, 2004
202
0
76
Originally posted by: bob4432
have you restarted the machine? or apache? maybe it is like in apache how you can config the config file, but it doesn't change until you restart apache.
heh, that was the problem.. I didn't realize apache only checks php.ini on restart. it works now. thanks!
 

bob4432

Lifer
Sep 6, 2003
11,726
45
91
Originally posted by: bitt3n
Originally posted by: bob4432
have you restarted the machine? or apache? maybe it is like in apache how you can config the config file, but it doesn't change until you restart apache.
heh, that was the problem.. I didn't realize apache only checks php.ini on restart. it works now. thanks!

glad it is working :)