phpmailer - The following SMTP Error: Data not accepted

后端 未结 15 1024
半阙折子戏
半阙折子戏 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:30

    Over a certain message of size, it messes up the content when setting through $mail->Body.

    You can test it, if it works well with small messages, but doesn't work with larger (over 4-6 kB), then this is the problem.

    It seems to be the problem of $mail->Body, so you can get around this by setting the HTML body manually via $mail->MsgHTML($message). And then you can try to only add the non-html body by $mail->AltBody.

    Hope that I could help, feel free to provide more details, information.

    0 讨论(0)
  • 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;
    
    0 讨论(0)
  • 2020-12-01 18:36

    In my case in cpanel i have 'Register mail ids' option where i add my email address and after 30 minutes it works fine with simple php mail function.

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