I get this error when trying to send e-mail form with PHP Mailer 5.1:
SMTP Error: Could not connect to SMTP host. Error sending: SMTP Error: Could not connect to SMTP host.
<?php
require("PHPMailer5\class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.live.com';
$mail->Port = 25;
$mail->Username = 'davy_yg@hotmail.com';
$mail->Password = '****';
$mail->From='davy_yg@hotmail.com';
$mail->FromName="My site's mailer";
$mail->Body = $newcomments;
$mail->Sender='davy_yg@hotmail.com';
$mail->AddReplyTo("replies@example.com", "Replies for my site");
$mail->AddAddress("plasteezy@yahoo.com");
//$mail->Subject = $subject;
$mail->IsHTML(true);#$mail->AddAttachment('http://www.branddesignexpress.com/images/homepage_mainimage.jpg', 'homepage_mainimage.jpg');
$mail->AddEmbeddedImage('homepage_mainimage.jpg', 'logoimg', 'homepage_mainimage.jpg'); // attach file logo.jpg, and later link to it using identfier //logoimg$mail->Body = $msg;$mail->AltBody="This is text only alternative body.";
if(!$mail->Send()){ echo "Error sending: " . $mail->ErrorInfo;
}else{ echo "Letter is sent";}
?>
What did I do wrong in the setting? or perhaps I should find a new php mailer. What version would be better? What's the link (I've looking for another link but do not find another link for PHP Mailer version 5 and above.