phpmailer could not authenticate on my server
Hello,
i have problem with a cms plugin in wordpress. it require smtp to send.
i setup an email account on my server but it not works.the plugin uses phpmailer.
so i setup a folder with fresh phpmailer from github but i got the same error:
# php test_smtp.php
2023-03-20 16:43:02 Connection: opening to ssl://xxxxx.xxxxx.xxx:465, timeout=300, options=array()
2023-03-20 16:43:02 Connection: opened
2023-03-20 16:43:02 SERVER -> CLIENT: 220-xxxxx.xxxxx.xxx ESMTP Exim 4.96 #2 Mon, 20 Mar 2023 17:43:02 +0100
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
2023-03-20 16:43:02 CLIENT -> SERVER: EHLO xxxxx.xxxxx.xxx
2023-03-20 16:43:02 SERVER -> CLIENT: 250-xxxxx.xxxxx.xxx Hello xxxxx.xxxxx.xxx [xx.xx.xx.xx]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-PIPECONNECT
250 HELP
2023-03-20 16:43:02 SMTP Error: Could not authenticate.
2023-03-20 16:43:02 CLIENT -> SERVER: QUIT
2023-03-20 16:43:02 SERVER -> CLIENT: 221 xxxxx.xxxxx.xxx closing connection
2023-03-20 16:43:02 Connection: closed
2023-03-20 16:43:02 SMTP Error: Could not authenticate.
of course username and password are correct (tested on webmail)
i try to disable firewall but no success.
setup is:
$mail->SMTPDebug = 3;
$mail->isSMTP();
$mail->Host = 'hostname';
$mail->SMTPAuth = true;
$mail->Username = 'email';
$mail->Password = 'zzzzzzzzzz';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
$mail->Port = 465;
exim is working good with email clients like outlook or mail so i do not understand. what can i check ?
thanks
-
hello, thanks for your reply i just found that using option $mail->SMTPAuth = false; it works what does it mean? i do not have open relay.. 0 -
thanks @cPRex , I actually already set debugging to verbose what worries me is why if I set SMTPauth to false it works ,while if I set it to true it doesn't work (authentication error) it seems strange to me that any php page can submit without authentication I would like to know if this is normal behavior or if there is something wrong with my whm/cpanel security settings. 0 -
Thanks for the additional details. Is it possible that the PHP application is being executed by "nobody" instead of the cPanel user? That could cause odd behavior with the authentication. 0 -
no no user is executing script also i have smtp restrictions on cpanel and firewall disabled 0 -
At this point it would be best to creat a ticket with our team so we can look into this issue directly. 0
Please sign in to leave a comment.
Comments
7 comments