PHPMailer authentication error

PHPMailer authentication error

Hello,

I'm setting up PHP Mailer to send emails from my website's form,  but I'm receiving an authentication error.
I also tried creating an APP password for this account, but still not working.

The username /password are the same used to login into my dashboard.

Here is the code I'm using:
    $mail->isSMTP();
    $mail->Host = 'smtppro.zoho.com';
    $mail->SMTPSecure = 'ssl';
    $mail->Port='465';  
    $mail->SMTPAuth=true;
    $mail->Username="myusername@domain.com";
    $mail->Password="##REMOVED##"; //APP Password
    $mail->SMTPOptions = array('ssl' => array('verify_peer' => false,'verify_peer_name' => false,'allow_self_signed' => true));
    $mail->setFrom('contact@mywebsite.com', 'My Name);
    $mail->addAddress("customeremail@email.com", "Cust Name");     // Add a recipient

    $mail->isHTML(true); 
    $mail->Subject = "Website Form";
    $mail->Body    = "Message goes here...";
    $mail->AltBody = 'You need a HTML email client to see this message';
    $mail->send();

And this is the log:

2023-12-21 18:13:28 Connection: opened

2023-12-21 18:13:28 SMTP INBOUND: "220-mi3-ss120.a2hosting.com ESMTP Exim 4.96.2 #2 Thu, 21 Dec 2023 13:13:28 -0500"

2023-12-21 18:13:28 SMTP INBOUND: "220-We do not authorize the use of this system to transport unsolicited,"

2023-12-21 18:13:28 SMTP INBOUND: "220 and/or bulk e-mail."

2023-12-21 18:13:28 SERVER -> CLIENT: 220-mi3-ss120.a2hosting.com ESMTP Exim 4.96.2 #2 Thu, 21 Dec 2023 13:13:28 -0500 

                                     220-We do not authorize the use of this system to transport unsolicited, 

                                     220 and/or bulk e-mail.

2023-12-21 18:13:28 CLIENT -> SERVER: EHLO mi3-ss120.a2hosting.com

2023-12-21 18:13:28 SMTP INBOUND: "250-mi3-ss120.a2hosting.com Hello mi3-ss120.a2hosting.com [66.198.240.49]"

2023-12-21 18:13:28 SMTP INBOUND: "250-SIZE 78643200"

2023-12-21 18:13:28 SMTP INBOUND: "250-8BITMIME"

2023-12-21 18:13:28 SMTP INBOUND: "250-PIPELINING"

2023-12-21 18:13:28 SMTP INBOUND: "250-PIPECONNECT"

2023-12-21 18:13:28 SMTP INBOUND: "250-AUTH PLAIN LOGIN"

2023-12-21 18:13:28 SMTP INBOUND: "250 HELP"

2023-12-21 18:13:28 SERVER -> CLIENT: 250-mi3-ss120.a2hosting.com Hello mi3-ss120.a2hosting.com [66.198.240.49]

                                     250-SIZE 78643200

                                     250-8BITMIME

                                     250-PIPELINING

                                     250-PIPECONNECT

                                     250-AUTH PLAIN LOGIN

                                     250 HELP

2023-12-21 18:13:28 Auth method requested: UNSPECIFIED

2023-12-21 18:13:28 Auth methods available on the server: PLAIN,LOGIN

2023-12-21 18:13:28 Requested auth method not available:

2023-12-21 18:13:28 Auth method selected: LOGIN

2023-12-21 18:13:28 CLIENT -> SERVER: AUTH LOGIN

2023-12-21 18:13:28 SMTP INBOUND: "334 VXNlcm5hbWU6"

2023-12-21 18:13:28 SERVER -> CLIENT: 334 VXNlcm5hbWU6

2023-12-21 18:13:28 CLIENT -> SERVER: c29zQHRoZXJhaWRzcGVjaWFsaXN0LmNvbQ==

2023-12-21 18:13:28 SMTP INBOUND: "334 UGFzc3dvcmQ6"

2023-12-21 18:13:28 SERVER -> CLIENT: 334 UGFzc3dvcmQ6

2023-12-21 18:13:28 CLIENT -> SERVER: OVkwUHVTSlpXbWFD

2023-12-21 18:13:30 SMTP INBOUND: "535 Incorrect authentication data"

2023-12-21 18:13:30 SERVER -> CLIENT: 535 Incorrect authentication data

2023-12-21 18:13:30 SMTP ERROR: Password command failed: 535 Incorrect authentication data

2023-12-21 18:13:30 SMTP Error: Could not authenticate.

2023-12-21 18:13:30 CLIENT -> SERVER: QUIT

2023-12-21 18:13:30 SMTP INBOUND: "221 mi3-ss120.a2hosting.com closing connection"

2023-12-21 18:13:30 SERVER -> CLIENT: 221 mi3-ss120.a2hosting.com closing connection

2023-12-21 18:13:30 Connection: closed

2023-12-21 18:13:30 SMTP Error: Could not authenticate.


Any idea on what is going on?