PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, July 6, 2022

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

 July 06, 2022     php, phpmailer, smtp     No comments   

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,

  • https://developers.google.com/gmail/imap/imap-smtp
  • https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040


Answered By - Al-Amin Firdows
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

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

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing