Phpmailer: SMTP connect() failed

Asked

Viewed 53 times

0

I am making authenticated submissions, but it is strange that sometimes it sends normally, and other failures occur. The client insists that on his server everything is correct, and now I am already without arguments. The version I use is 5.2.8, someone would have some suggestion?

$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPAuth = true;
$mail->SMTPDebug = 0;
$mail->Debugoutput = 'html';
$mail->Host = $email_host;
$mail->Port = $email_port; //587
$mail->Username = $email_send;
$mail->Password = $email_pass;
$mail->setFrom($email_send, 'Site');
$mail->addAddress($destino);

if ($mail->send())
{
    echo 'Enviado';
}
else
{
    echo $mail->ErrorInfo;
}
  • can post the error that is shown?

  • It seems that the problem was solved, but previously the message was "SMTP connect() failed"

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.