Could not connect to SMTP host. Message could not be sent

前端 未结 4 835
清酒与你
清酒与你 2021-01-29 05:21

When I sent email from server then it gives me two error -

SMTP Error: Could not connect to SMTP host. Message could not be sent. Mailer Error: SMTP Er

相关标签:
4条回答
  • 2021-01-29 05:56

    The Gmail Help :

    Still can't send mail?

    If you tried configuring your SMTP server on port 465 (with SSL/TLS) and port 587 (with STARTTLS), but are still having trouble sending mail, try configuring your SMTP to use port 25 (with SSL/TLS).

    0 讨论(0)
  • 2021-01-29 06:00

    Try phpmailer in debug mode to check the error

    $mail->SMTPDebug = 3;       // Enable verbose debug output
    
    0 讨论(0)
  • 2021-01-29 06:03

    This question failed to do a basic search and missed a vital piece of information later mentioned in comments: the OP is using GoDaddy. GoDaddy is well known to block outbound SMTP, so any suggestions relating to switching port numbers or security protocols will not help. You need to read other questions on GoDaddy's mail handling, and read their support documentation, which will push you in the direction of using GoDaddy's mail servers (using securehosting domains) or via localhost as a relay to the same. All of this is also covered in the PHPMailer troubleshooting guide.

    In future, search before posting, as per the SO guidelines.

    0 讨论(0)
  • 2021-01-29 06:04

    First logout the your gmail account

    then open this url use this yrl

    click the continue button

    Next change the port and SMTPsecure

    $mail->SMTPSecure = "tls";
    $mail->Port = 587;
    
    0 讨论(0)
提交回复
热议问题