Jump to content
Sign in to follow this  
hairydog

Email sending setup

Recommended Posts

When I tried to set up email sending in the Admn, using the phpmail setting works, but smtp ssl or tls both fail with an error message that says the authentication failed, even though I just pasted the password and username into the server as well as the field in the Admin.

The same details definitely work in the webmail, so something odd is happening in phpmailer 6.0.7

Share this post


Link to post
Share on other sites

Username and password are not the only things used for authentication for SMTP - you need the correct server name and correct port.

SMTP is far superior to phpMail in terms of security, deliverability (many emails sent via phpMail will go into spam as they are unauthenticated) and traceability so it is a good idea to swap over.  That along with the fact that phpMail will be phased out in the near future and some hosting companies already disable it's use on server security grounds

Ian

Share this post


Link to post
Share on other sites

Yes, but the server and port settings are correct. It successfully connects to the correct host through the specified port. The pop-up window shows that. What fails is the user authentication.

The user details are correct. I set them using paste and paste, so as to rule out any possible typos.

Share this post


Link to post
Share on other sites

OK - dont suppose you have any "special" characters in your password ?  If so you will need to change the password to remove them and have numbers, uppercase or lowercase letters only - bug that has been around and reported for a long time !

Share this post


Link to post
Share on other sites

That is the only known problem and we use SMTP across many hundreds of CubeCart websites with no issues at all

Ian

Share this post


Link to post
Share on other sites
2020-07-07 16:05:57 SERVER -> CLIENT: 220 [server].co.uk ESMTP Exim Tue, 07 Jul 2020 17:05:57 +0100
2020-07-07 16:05:57 CLIENT -> SERVER: EHLO www.[domain].uk
2020-07-07 16:05:57 SERVER -> CLIENT: 250-[server].co.uk Hello www.[domain].uk [212.110.172.147]250-SIZE 52428800250-8BITMIME250-PIPELINING250-CHUNKING250-STARTTLS250 HELP
2020-07-07 16:05:57 CLIENT -> SERVER: STARTTLS
2020-07-07 16:05:57 SERVER -> CLIENT: 220 TLS go ahead
2020-07-07 16:05:57 CLIENT -> SERVER: EHLO www.[domain].uk
2020-07-07 16:05:57 SERVER -> CLIENT: 250-[server].co.uk Hello www.[domain].uk [212.110.172.147]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-CHUNKING250 HELP
2020-07-07 16:05:57 CLIENT -> SERVER: AUTH LOGIN
2020-07-07 16:05:57 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2020-07-07 16:05:57 CLIENT -> SERVER: <credentials hidden>
2020-07-07 16:05:57 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2020-07-07 16:05:57 CLIENT -> SERVER: <credentials hidden>
2020-07-07 16:05:59 SERVER -> CLIENT: 535 Incorrect authentication data
2020-07-07 16:05:59 SMTP ERROR: Password command failed: 535 Incorrect authentication data
SMTP Error: Could not authenticate.
2020-07-07 16:05:59 CLIENT -> SERVER: QUIT
2020-07-07 16:05:59 SERVER -> CLIENT: 221 [server].co.uk closing connection
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

 Is there a way to see the <credentials hidden>  that this popup hides?

Share this post


Link to post
Share on other sites

Well, probably, and I will get to that in a minute or two.

Please know that, in our experience, using a mouse swipe (and sometimes even the keyboard) to highlight and then copy/paste text from one location to another will invariably also catch leading or trailing invisible (whitespace) characters, such as a tab character.

Please try manually typing in the username and password into the form and retesting.

Share this post


Link to post
Share on other sites

In classes/ajax.class.php, near line 286:

Find:

$test_mailer->SMTPDebug = 2;

Change to:

$test_mailer->SMTPDebug = 4;

A PHPMailer debug level of 4 (DEBUG_LOWLEVEL) will not conceal the credentials of the debug output. Also, this debug level generates much more output.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...