Send email via Gmail SMTP server in PHP

Gmail SMTP


2021-05-16 23:45:13 SERVER -> CLIENT: 220-ambient.aslinser2.com ESMTP Exim 4.94.2 #2 Sun, 16 May 2021 18:45:13 -0500 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2021-05-16 23:45:13 CLIENT -> SERVER: EHLO 1st-choice-formations.co.uk
2021-05-16 23:45:13 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
2021-05-16 23:45:13 CLIENT -> SERVER: STARTTLS
2021-05-16 23:45:13 SERVER -> CLIENT: 220 TLS go ahead
2021-05-16 23:45:13 CLIENT -> SERVER: EHLO 1st-choice-formations.co.uk
2021-05-16 23:45:13 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
2021-05-16 23:45:13 CLIENT -> SERVER: AUTH LOGIN
2021-05-16 23:45:13 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2021-05-16 23:45:13 CLIENT -> SERVER: <credentials hidden>
2021-05-16 23:45:13 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2021-05-16 23:45:13 CLIENT -> SERVER: <credentials hidden>
2021-05-16 23:45:15 SERVER -> CLIENT: 535 Incorrect authentication data
2021-05-16 23:45:15 SMTP ERROR: Password command failed: 535 Incorrect authentication data
SMTP Error: Could not authenticate.
2021-05-16 23:45:15 CLIENT -> SERVER: QUIT
2021-05-16 23:45:15 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