fsockopen()

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
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

fsockopen()

Post by aceconcepts »

Hi,

I am trying to get PHPMailer working.

The below error occurs:

Code: Select all

Warning: fsockopen() [function.fsockopen]: unable to connect to smtp.easynet.co.uk:25 in /home/q2q/public_html/phpmailer/class.smtp.php on line 105
Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host.
When I run the following script:

Code: Select all

<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.easynet.co.uk"; // SMTP server
$mail->From = "me@mydomain.co.uk";
$mail->AddAddress("myfriend@domain.co.uk");

$mail->Subject = "First PHPMailer Message";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send())
{
   echo 'Message was not sent.';
   echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
   echo 'Message has been sent.';
}
?>
Any idea how I can resolve this error?
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

There is a special swiftmailer subforum on this board.
I think you'll get more help there!
Post Reply