can't send mail using smtp authentication
we i try to send mail using phpMailer via smtp authentication it showing error as follows
SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.
code as below
$mail = new PHPMailer();
$mail->isSMTP();
$mail->CharSet = 'UTF-8';
// Set mailer to use SMTP
$mail->Host = 'smtp.zoho.com'; // Specify main and backup server
$mail->SMTPDebug = true;
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'info@tanfidh.com'; // SMTP username
$mail->Password = 'xxxxxx'; // SMTP password
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->From = "info@tanfidh.com";
$mail->FromName = "some name";
$mail->AddAddress("xxx@tanfidh.com");
//$mail->AddAddress($to1);
$mail->WordWrap = 50;
$mail->isHTML(true);
$mail->Subject = "mail subject";
$mail->Body = "testmail";
if(!$mail->send()) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit();
}
else
{
echo 'success';
}
please help me to sort out this isue