raytowle Posted May 11, 2018 Share Posted May 11, 2018 Hi First time posting, so please bear with me if i missing anything.... I have been having issues with CubeCart SMTP functionality. When filling in the form for the mail settings, and then sending a test email, I get an error saying "could not connect to server". This has had me stumped for a couple of days - until I realised that the tests are not trying to connect with the host that I have specified in the SMTP host field. I use office 365 SMTP so their mail server is smtp.offic365.com which uses TLS and port 587. However, every time I verify these details and attempt a test email - I get a response from the server where the website is hosted on - not office 365's mail server. I have raised this with the web host provider, and they have assured me that because I am specifying the host "smtp.office365.com", the problem isnt with their server.... I feel like i'm going round in circles, but the SMTP response deffinitely does not come from the server I put in to the smtp host section in CubeCart. Just for the records, I've also tried googles smtp server and that doesnt go through either... that also responds with my hosts server - not the one I enter in the smtp host box on CubeCart.... These are the first few lines of the failed test email button (i have replaced the real domain with sub.domain for security reasons...): SERVER -> CLIENT: 220-figo.dnetdns.com ESMTP Exim 4.89_1 #1 Fri, 11 May 2018 17:58:47 +0000 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. CLIENT -> SERVER: EHLO sub.domain.co.uk SERVER -> CLIENT: 250-figo.dnetdns.com Hello sub.domain.co.uk [31.193.140.218]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP CLIENT -> SERVER: STARTTLS SERVER -> CLIENT: 220 TLS go ahead CLIENT -> SERVER: EHLO sub.domain.co.uk I would expect my response to come back with something like: SERVER -> CLIENT: 220 LO2P265CA0060.outlook.office365.com Microsoft ESMTP MAIL Service ready at Sat, 10 Feb 2018 21:45:11 +0000 Sooo. has any one any ideas? Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 11, 2018 Share Posted May 11, 2018 In admin, Store Settings, Advanced tab, please make sure the Sending Method is at SMTP with TLS (Recommended). Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 11, 2018 Author Share Posted May 11, 2018 Yep... been there, done that..... saved the settings... applied them... tested.... still trying to connect to the wrong server.... its like it's ignoring the smtp host box and just connecting to localhost..... Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 11, 2018 Share Posted May 11, 2018 In CC620, there is a new Clear Cache indicator at the upper-right. Is this button lit? If so, click it and see if anything changes. If not, then we will look a bit deeper. Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 11, 2018 Author Share Posted May 11, 2018 Hi. It's not lit... I have seen (and used) the 'clear cache' button... but to no avail sadly Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted May 11, 2018 Share Posted May 11, 2018 It doesn't look like it from your log but a significant proportion of hosts will block external connections such as SMTP connections to office, gmail etc... Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 11, 2018 Share Posted May 11, 2018 (edited) Being blocked would get a different error response. Initially you said "Could not connect to server". Then you said the test response is saying it is connecting, but to the wrong server. Maybe in PHPMailer's eyes, that's the same error. Open the admin template settings.index.php for editing. At the very end, add {debug}. Save. Request the Store Settings page. Your browser will want to throw a popup window. Let it. (You may need to re-request that page as the popup may contain the entire page, which we don't want.) In the left pane of the popup, scroll to $CONFIG. In the right pane, find the group of settings related to the email settings. Verify host and port. Edited May 11, 2018 by bsmither Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted May 11, 2018 Share Posted May 11, 2018 Yes exactly. Sorry not very helpful. I've turned my Mac off now and relaxing with a glass of wine. Only one (or two) mind as baby #2 is imminent! 1 Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 11, 2018 Author Share Posted May 11, 2018 (edited) Ok, so the debug file says this: email_smtp_host => "smtp.office365.com" email_smtp_port => "587" email_method => "smtp_tls" So i guess thats all ok...? Edited May 11, 2018 by raytowle Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 11, 2018 Share Posted May 11, 2018 The config is what you say it is, and PHPMailer will be initialized to use that. I would strive to communicate with a higher level tier support (RS Hosting?). Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 11, 2018 Author Share Posted May 11, 2018 It is RS hosting yes..... although I'm thinking about jumping ship.... they were cheap enough so I might just cut my losses. Any suggestions for a web host? I dont need email / DNS anything... just a reasonable web host,..... Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted May 11, 2018 Share Posted May 11, 2018 @raytowle sounds like you are technically minded. On those grounds why not order a VPS you have 100% controller of. Checkout DigitalOcean, Linode & Vultr (amongst others). Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 11, 2018 Author Share Posted May 11, 2018 1 minute ago, Al Brookbanks said: @raytowle sounds like you are technically minded. On those grounds why not order a VPS you have 100% controller of. Checkout DigitalOcean, Linode & Vultr (amongst others). Literally thinking about a VPS right now..... does it have to be linux, or can it be windows? Im fairly ok with linux, but i know windows better..... Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted May 11, 2018 Share Posted May 11, 2018 I'd chose CloudLinux with cPanel. Or CentOS with cPanel to save cash. @bsmither would say Windows. Either is ok really but CubeCart is more geared to Linux and I hate Windows personally. 1 Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 11, 2018 Author Share Posted May 11, 2018 1 minute ago, Al Brookbanks said: I'd chose CloudLinux with cPanel. Or CentOS with cPanel to save cash. @bsmither would say Windows. Either is ok really but CubeCart is more geared to Linux and I hate Windows personally. Great - i'll explore the linux options there then thanks. Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 21, 2018 Author Share Posted May 21, 2018 (edited) Hi. So, after some time, I've created a LAMP server on Linux. The server is installed with CubeCart 6.2.0 I haven't made any changes to anything other than the mail server settings, of which have been set to Office 365's SMTP settings with TLS, but still get a very similar response when trying to send a test email: SERVER -> CLIENT: 220 DM5PR19CA0021.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 17 May 2018 17:50:34 +0000 CLIENT -> SERVER: EHLO 23.100.78.132 SERVER -> CLIENT: 250-DM5PR19CA0021.outlook.office365.com Hello [23.100.78.132]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8 CLIENT -> SERVER: STARTTLS SERVER -> CLIENT: 220 2.0.0 SMTP server ready CLIENT -> SERVER: EHLO 23.100.78.132 SERVER -> CLIENT: 250-DM5PR19CA0021.outlook.office365.com Hello [23.100.78.132]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN XOAUTH2250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8 CLIENT -> SERVER: AUTH LOGIN SERVER -> CLIENT: 334 XXXXXXXXXXXXXXXX CLIENT -> SERVER: XXXXXXXXXXXXXXXXXX SERVER -> CLIENT: 334 XXXXXXXXXXXXXXXXXXX CLIENT -> SERVER: XXXXXXXXXXXXXXX SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful [DM5PR19CA0021.namprd19.prod.outlook.com] SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [DM5PR19CA0021.namprd19.prod.outlook.com] SMTP Error: Could not authenticate. CLIENT -> SERVER: QUIT SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel SMTP connect() failed. I've spoken to Office 365 support and I also have a NAS and some separate backup software which can authenticate successfully using Office 365, so I am now wondering if there is something which needs tweaking in CubeCart or if there's something obvious I'm missing? Any help would be hugely appreciated as I'm now scratching my head on this one. Ray Edited May 21, 2018 by raytowle Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 21, 2018 Share Posted May 21, 2018 (edited) Please obfuscate the two response lines that appear after the lines that start with: SERVER -> CLIENT: 334 CLIENT -> SERVER: XXXXX out these responses. Edited May 21, 2018 by bsmither Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 21, 2018 Author Share Posted May 21, 2018 Do you mean hide? Or unhide? This is how the error log is produced by CubeCart so if you mean "show the details" I dont know if I can.... Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 21, 2018 Share Posted May 21, 2018 In your post above, make an edit to it so that the hashes are X'd out.: SERVER -> CLIENT: 334 VXNlcm5hbWU6 CLIENT -> SERVER: XXXXXXXXXXXXXXXXX and the pair following Those hashes are simple encodings that contain your email username and password. Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 21, 2018 Author Share Posted May 21, 2018 2 minutes ago, bsmither said: In your post above, make an edit to it so that the hashes are X'd out.: SERVER -> CLIENT: 334 VXNlcm5hbWU6 CLIENT -> SERVER: XXXXXXXXXXXXXXXXX and the pair following Those hashes are simple encodings that contain your email username and password. Ok, Sorry, Didn't realise... I thought this was hashed out. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 21, 2018 Share Posted May 21, 2018 (edited) So, the conversation between client and server appears normal. There doesn't appear to be any hidden spaces before or after the username or password (a common problem), but double-check anyway. The rejection notice specifically mentions the password failed. (Although, that phrase seems overly generic.) The next point of unauthorized usage could be that Office365 (an Exchange-based server?) restricts access based on IP address - but you say your NAS and backup app can use SMTP and they, I assume, are seen on the same IP address. I also assume the Office365 support had no relevant suggestions. Edited May 21, 2018 by bsmither Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 22, 2018 Author Share Posted May 22, 2018 Hi. So, after a LOT of head scratching and reading through TLS / opensll article / php info etc, I have made some progress using phpmailer and changing the default settings in the php mailer config file which resulted in a test email being sent and successfully received. However - my working tests didnt last long and every time I now run the 'test email' - I get an error: "Testing PHP mail() Function. Test failed to execute." Is this normal? Or is this a red herring? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted May 22, 2018 Share Posted May 22, 2018 Could well be a red herring. You could try. Real life test like password reset and see if the email arrives. Quote Link to comment Share on other sites More sharing options...
raytowle Posted May 22, 2018 Author Share Posted May 22, 2018 Yea, in the process of restoring a backup of a working site to test this theory.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.