Problem with SMTP authentication in PHP using PHPMailer, with Pear Mail works

后端 未结 7 947
[愿得一人]
[愿得一人] 2021-02-01 06:58

I´m having trouble sending a e-mail with the PHPMailer class, but it works with PEAR Mail::factory.

I guess the problem is with the SMTP authentication, but I couldn´t f

相关标签:
7条回答
  • 2021-02-01 07:46

    This happened to me as well. For me, Postfix was located at the same server as the PHP script, and the error was happening when I would be using SMTP authentication and smtp.domain.com instead of localhost.

    So when I commented out these lines:

    $mail->SMTPAuth = true;
    $mail->SMTPSecure = "tls";

    and set the host to

    $mail->Host = "localhost";
    

    instead

    $mail->Host = 'smtp.mydomainiuse.com'

    and it worked :)

    0 讨论(0)
提交回复
热议问题