Wednesday, July 6, 2022

[FIXED] How to fix send PHPMailer SMTP mail on GoDaddy Server 500 (Internal Server) Error

Issue

When I try to send a mail from GoDaddy Server by PHPMailer (SMTP) it shows the 500 (Internal Server) Error.

My Code Is:

    ini_set('display_errors', 1);
    error_reporting(E_ALL);

    require 'vendor/autoload.php';
    use PHPMailer\PHPMailer\PHPMailer;
    use PHPMailer\PHPMailer\Exception;

    $mail = new PHPMailer(true);


    $mail->isSMTP(); 
    $mail->Host = 'SERVER.secureserver.net';    // Must be GoDaddy host name
    $mail->SMTPAuth = true; 
    $mail->Username = 'EMAIL';
    $mail->Password = 'PASSWORD';
    $mail->SMTPSecure = 'tls';   // ssl will no longer work on GoDaddy CPanel SMTP
    $mail->Port = 587;    // Must use port 587 with TLS



  $mail->setFrom('EMAIL', 'NAME');
  $mail->addAddress('EMAIL', 'NAME');

  $mail->Subject = 'Mail Subject';
  $mail->Body = 'Mail Body';

  $send = $mail->send();
?>

It returns the 500 (Internal Server) Error.


Solution

For those who visited this page now.

GoDaddy email doesn't support TLS

To ensure the highest level of security for your email, TLS versions 1.0 and 1.1 are no longer supported by GoDaddy.

Ref: https://in.godaddy.com/help/tls-10-and-11-end-of-support-41090


In this case, use Gmail or Outlook SMTP

You may follow this guides,



Answered By - Al-Amin Firdows
Answer Checked By - Marie Seifert (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.