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)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.