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.