Page 1 of 1

Mail Function Not Working

Posted: Sat Oct 08, 2005 9:14 am
by ashrafzia
Hello to All!

I am sending e-mail from my own computer using PHP mail function. i got the following 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 C:apachefriendsxampphtdocsxamppmailmail.php on line 9

An error occurred when sending the email to ashrafzia@gmail.com from ashrafzia@yahoo.com


i have made the following changes in PHP.ini file;

1- smtp=localhost
2- sendmail_from=ashrafzia@yahoo.com

Are there any more changes to do in it?

Q#2: How can i change the port number?

I would be very thankful for any Reply.

Posted: Sat Oct 08, 2005 12:38 pm
by anjanesh
1. Most ISPs block port 25 to avoid Spam emails.
2. You'll need to have SMTP enabled in Yahoo if you're going to use a yahoo id.

I dont know how to get this done - but do post a reply if you're successful.
Try using phpmailer - I've tried sending mails through Gmail but no luck.

Posted: Sun Oct 09, 2005 2:23 am
by ashrafzia
Thanx for Reply :

I'll Check it out