Dumps Posted March 13, 2007 Share Posted March 13, 2007 I have Apache 2.0.59, PHP 5.2.1 and Postcast sever free edition v.2.6.0. I can send mail using Thunderbird to Postcast without a problem. Postcast has the hostname set as localhost and the port set as 25. My problem is that I cannot send mail using the phpmailer class. My test code is as follows; <?php require("class.phpmailer.php"); require("class.smtp.php"); require("phpmailer.lang-en.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "127.0.0.1;localhost"; // SMTP server $mail->From = "Richard@richandclaire.net"; $mail->AddAddress("pilsdumps@gmail.com"); $mail->Subject = "first mailing"; $mail->Body = "hi ! \n\n this is First mailing I made myself with PHPMailer !"; $mail->WordWrap = 50; if(!$mail->Send()) { echo "Message was not sent"; echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; } ?> This returns the following error message; Warning: fsockopen() [function.fsockopen]: unable to connect to 127.0.0.1:25 (An established connection was aborted by the software in your host machine. ) in C:\Web\Webserver\Apache\Apache2\htdocs\tests\phpmailer\class.smtp.php on line 105 Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (An established connection was aborted by the software in your host machine. ) in C:\Web\Webserver\Apache\Apache2\htdocs\tests\phpmailer\class.smtp.php on line 105 Message was not sentMailer Error: SMTP Error: Could not connect to SMTP host. Any ideas why this doesn't work? This is my work machine and its frustrating because I have this successfully working at home. Quote Link to comment Share on other sites More sharing options...
Dumps Posted March 13, 2007 Author Share Posted March 13, 2007 Fixed. My McAfee anti-virus had blocked port 25. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.