PHP mail()

Reply

Join Date: Oct 2009
Posts: 1
Reputation: abhi.agrawal87 is an unknown quantity at this point 
Solved Threads: 0
abhi.agrawal87 abhi.agrawal87 is offline Offline
Newbie Poster

PHP mail()

 
0
  #1
Oct 9th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 178
Reputation: codejoust is an unknown quantity at this point 
Solved Threads: 18
codejoust's Avatar
codejoust codejoust is offline Offline
Junior Poster
 
0
  #2
Oct 9th, 2009
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.
Reply With Quote Quick reply to this message  
Reply

Tags
mail, php, smtp

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC