Send email via Gmail SMTP server in PHP

Gmail SMTP


2022-01-24 22:19:36 SERVER -> CLIENT: 220-ambient.aslinser2.com ESMTP Exim 4.94.2 #2 Mon, 24 Jan 2022 16:19:36 -0600 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2022-01-24 22:19:36 CLIENT -> SERVER: EHLO 1st-choice-formations.co.uk
2022-01-24 22:19:36 SERVER -> CLIENT: 250-ambient.aslinser2.com Hello 1st-choice-formations.co.uk [107.150.46.66]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPE_CONNECT250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2022-01-24 22:19:36 CLIENT -> SERVER: STARTTLS
2022-01-24 22:19:36 SERVER -> CLIENT: 220 TLS go ahead
2022-01-24 22:19:36 CLIENT -> SERVER: EHLO 1st-choice-formations.co.uk
2022-01-24 22:19:36 SERVER -> CLIENT: 250-ambient.aslinser2.com Hello 1st-choice-formations.co.uk [107.150.46.66]250-SIZE 52428800250-8BITMIME250-PIPELINING250-PIPE_CONNECT250-AUTH PLAIN LOGIN250 HELP
2022-01-24 22:19:36 CLIENT -> SERVER: AUTH LOGIN
2022-01-24 22:19:36 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2022-01-24 22:19:36 CLIENT -> SERVER: <credentials hidden>
2022-01-24 22:19:36 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2022-01-24 22:19:36 CLIENT -> SERVER: <credentials hidden>
2022-01-24 22:19:38 SERVER -> CLIENT: 535 Incorrect authentication data
2022-01-24 22:19:38 SMTP ERROR: Password command failed: 535 Incorrect authentication data
SMTP Error: Could not authenticate.
2022-01-24 22:19:38 CLIENT -> SERVER: QUIT
2022-01-24 22:19:38 SERVER -> CLIENT: 221 ambient.aslinser2.com closing connection
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

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