Send email via Gmail SMTP server in PHP

Gmail SMTP


2024-04-19 23:49:57 SERVER -> CLIENT: 220-ambient.aslinser2.com ESMTP Exim 4.96.2 #2 Sat, 20 Apr 2024 00:49:57 +0100 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2024-04-19 23:49:57 CLIENT -> SERVER: EHLO 1st-choice-formations.co.uk
2024-04-19 23:49:57 SERVER -> CLIENT: 250-ambient.aslinser2.com Hello 1st-choice-formations.co.uk [107.150.46.66]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPECONNECT250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2024-04-19 23:49:57 CLIENT -> SERVER: STARTTLS
2024-04-19 23:49:57 SERVER -> CLIENT: 220 TLS go ahead
SMTP Error: Could not connect to SMTP host.
2024-04-19 23:49:57 CLIENT -> SERVER: QUIT
2024-04-19 23:49:58
2024-04-19 23:49:58
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting