phpmailer - The following SMTP Error: Data not accepted

后端 未结 15 1020
半阙折子戏
半阙折子戏 2020-12-01 17:34

I\'m trying to figure out this issue for 6 hours. But there is nothing to make sense. Here is the scenario; There is a well formatted HTML template.

<         


        
15条回答
  •  北海茫月
    2020-12-01 18:36

    Interestingly, I had the same exact issue and for me the problem was that my connection was timing out. To be able to see more details on my connections, I added $mail->SMTPDebug = 4; to my phpmailer (look up how to capture the debug since the default output function is echo).

    Here's the result:

    SMTP -> get_lines(): $data was ""
    SMTP -> get_lines(): $str is ""
    SMTP -> get_lines(): $data is ""
    SMTP -> get_lines(): timed-out (10 seconds)
    SMTP -> FROM SERVER:
    SMTP -> ERROR: DATA not accepted from server: 
    

    The default timeout is set to 10 seconds. If your app can support more, add this line to your phpmailer:

    $mail->Timeout = 20;
    

提交回复
热议问题