phpemailerror-handlingsmtpphpmailer

I get PHPMailer SMTP Error while useing Go54 shared Host


I am trying to sent email using SMTP (PHP Mailer). I am using the aws SMS service. Below is my code:

$mail->isSMTP();
$mail->Host     = 'email-smtp.eu-west-1.amazonaws.com';
$mail->SMTPAuth = true;
$mail->Username = '---';
$mail->Password = '---';
$mail->SMTPSecure = 'tls';
$mail->Port     = 587;

I gat the following result from Debug error:

2024-08-18 05:14:11 SERVER -> CLIENT: 220-wghp7.wghservers.com ESMTP Exim 4.97.1 #2 Sun, 18 Aug 2024 06:14:11 +0100 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2024-08-18 05:14:11 CLIENT -> SERVER: EHLO agrop.co
2024-08-18 05:14:11 SERVER -> CLIENT: 250-wghp7.wghservers.com Hello agrop.co [131.153.147.178]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPECONNECT250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2024-08-18 05:14:11 CLIENT -> SERVER: STARTTLS
2024-08-18 05:14:11 SERVER -> CLIENT: 220 TLS go ahead
SMTP Error: Could not connect to SMTP host.
2024-08-18 05:14:11 CLIENT -> SERVER: QUIT
2024-08-18 05:14:11
2024-08-18 05:14:11
SMTP Error: Could not connect to SMTP host.

Solution

  • After much research, I am finally able to resolve the issue, I will like to drop it here to help anyone with the same issue in future.

    In my AWS SES, I verified only email identity (as I have done for a lot of other host) but my current host (go54.com) is not resolving the peer certificate to the AWS verified email. The solution that worked for me is verifying the domain as an identity on ASW SES and setting the DomainKeys Identified Mail (DKIM) provided by AWS SES on my host Zone Records. The domain then get verified (after a while).

    DKIM-signed messages help receiving mail servers validate that a message was not forged or altered in transit.

    With this my initial code work just fine. I hope this help someone.

    Thank you all for your help. KEEP CODING