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.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.';
}
?>