Mail Function Not Working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ashrafzia
Forum Commoner
Posts: 37
Joined: Wed Sep 28, 2005 12:23 pm

Mail Function Not Working

Post 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.
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post 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.
ashrafzia
Forum Commoner
Posts: 37
Joined: Wed Sep 28, 2005 12:23 pm

Post by ashrafzia »

Thanx for Reply :

I'll Check it out
Post Reply