954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP mail()

I have been using class.phpmailer.php script for sending mail from localhost without smtp server.
Everytime i try to send mail from my localhost then following error is generated:

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:\Program Files\Apache Software Foundation\Apache2.2\htdocs\send email\not working scripts\class.phpmailer.php on line 213
there was a problem sending this mail! Could not instantiate mail function.

in my php.ini SMTP is set to localhost and smtp_port is set to 25 without ";"

when using gmail smtp server with the same settings in php.ini then evrything works perfectly alright but this error is generated when not using smtp server.

Problem is that when i'm not connecting to SMTP server then why there is need to verify settings in php.ini

link: php mailer script @ http://phpmailer.sourceforge.net

Please anyone give solution to my problem.

Thanks.

abhi.agrawal87
Newbie Poster
1 post since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

Unless you have a mailserver running on localhost, port 25, PHP cannot send emails. You either need to change the SMTP ports or mail function.
SMTP remotely connects to a remote mail server, allowing you to email from it.

codejoust
Junior Poster
180 posts since Jul 2009
Reputation Points: 18
Solved Threads: 21
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: