Connecting Tech Pros Worldwide Forums | Help | Site Map

mail problem (mail server is running) but mail() is not working.

Newbie
 
Join Date: Jul 2006
Posts: 2
#1: Jul 24 '06
I have installed PHP , Apache on WinXP . I am using php mail function but i am getting error i also have installed Argosoft mail server and it is running properly using port 25 and php.ini is also configured properly. But i m getting error

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 D:\Program Files\Apache Group\Apache2\htdocs\email.php on line 8

please tell me the reason.When page is loaded request goes to smptp server
here is the log produced by mail server when request goes to server.
SMTP server started. Listening on port 25
7/24/2006 3:48:57 PM - POP3 server started. Listening on port 110
7/24/2006 3:48:57 PM - IMAP server started. Listening on port 143
7/24/2006 3:48:57 PM - Web server started. Listening on port 80
7/24/2006 3:48:57 PM - Using normal message scheme, Size=5
7/24/2006 3:49:29 PM - { 1} START SMTP
7/24/2006 3:49:29 PM - Requested SMTP connection from 127.0.0.1 [127.0.0.1], ID=1
7/24/2006 3:49:29 PM - ( 1) Evaluation period has expired
7/24/2006 3:49:29 PM - SMTP connection with 127.0.0.1 [127.0.0.1] ended. ID=1
7/24/2006 3:49:30 PM - { 1} END SMTP
7/24/2006 3:50:15 PM - { 2} START Web
Please help me out i have visited a lot of forums but i did'nt find any solution for that.
I will thankul for this.

sashi's Avatar
Expert
 
Join Date: Jun 2006
Location: Seremban, Malaysia
Posts: 1,630
#2: Jul 25 '06

re: mail problem (mail server is running) but mail() is not working.


Hi there,

open up your command prompt and type the following command to make sure you port 25 [smtp] is ready and listeing to incoming connection..

telnet localhost 25
ronverdonk's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#3: Jul 25 '06

re: mail problem (mail server is running) but mail() is not working.


I recall having this problem myself once. Reason was that I had
SMTP=localhost left in php.ini. After I changed it to a real mail server, e.g. SMTP=mail.provider.nl it ran.
Maybe this does not apply in your case, but ít is worth a try.

Ronald :cool:
Newbie
 
Join Date: Jul 2006
Posts: 2
#4: Jul 27 '06

re: mail problem (mail server is running) but mail() is not working.


i have run the command telnet localost 25 it gives the following result
501 Evaluation period has expired


Connection to host lost.

I am using cable net (LAN) how can ii ind my real server name????????
i have installed ARGOSOFT smtp server but wen it is started it gives thhe following messege i think problem is with this mail server. When it gets started it gives the ollowing messege
Mail server appaears to be started but incoming requests may not be accepted.
Newbie
 
Join Date: Jul 2006
Posts: 4
#5: Jul 28 '06

re: mail problem (mail server is running) but mail() is not working.


hi bilal ...
i was getting that error too ... after trying many options this works for me ...
in your c:\windows\php.ini go to this section:

[mail function]
; For Win32 only.
SMTP = writehereyoursmtpserver
smtp_port = 25

; For Win32 only.
sendmail_from = writeheremiuser@myemailserver

uncomment that lines , save your php.ini, restart your http server and try again sending email using your form :D ...

greetings ...
Newbie
 
Join Date: Aug 2006
Posts: 1
#6: Aug 4 '06

re: mail problem (mail server is running) but mail() is not working.


Well if the server is not yours then what you can do is try sending an smtp mail instead of using phpmail function. Search in google fpr further information.

Thanks

Jyot Vakharia
Reply