Page 1 of 1

does anyone how to solve this?

Posted: Fri Oct 28, 2011 8:34 pm
by jauson
Hi, does anyone how to solve this? I have a contact form but when I try it form doesnt work. Please give me suggestion. thanks.

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:\xampp\htdocs\test_run\hrportal\LeaveApplication.php on line 58
Please Try Again Later. Thank You.

this is my php.ini mail setup.


[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = jayson.lacson@da5.com.ph

Re: does anyone how to solve this?

Posted: Fri Oct 28, 2011 8:44 pm
by Celauran
Do you have a mail server installed? Is it running? Does it accept connections other than from PHP?

Re: does anyone how to solve this?

Posted: Fri Oct 28, 2011 8:49 pm
by jauson
what mail server? I didnt have an idea for that.

Re: does anyone how to solve this?

Posted: Fri Oct 28, 2011 9:10 pm
by Celauran
You can't send mail without a mail server. The error message says it can't connect to the mail server. Google

Re: does anyone how to solve this?

Posted: Fri Oct 28, 2011 9:15 pm
by jauson
yes I saw a thread for mail server. hm. thank you so much :D

Re: does anyone how to solve this?

Posted: Fri Oct 28, 2011 11:55 pm
by uday8486
This is due to your using a localhost. You need to put this code on a server which has a mail server.

Re: does anyone how to solve this?

Posted: Sat Oct 29, 2011 6:39 am
by Celauran
uday8486 wrote:This is due to your using a localhost.
No, it's not. You can run a mail server locally.

Re: does anyone how to solve this?

Posted: Sun Oct 30, 2011 4:13 am
by dsnraju
mail() function in php used to send emails.

The error displaying in your computer because you are using the code in localhost. put this code on a server which has a mail server

Re: does anyone how to solve this?

Posted: Sun Oct 30, 2011 6:38 am
by Celauran
dsnraju wrote:The error displaying in your computer because you are using the code in localhost.
Again, no. This is simply not true.