Error Message Could Not Be Sent. Mailer Error: Smtp Connect() Failed. Https://

email function not working on my cs cart

Upgrade 4.9.1 - 4.9.2

i got below error

Error Message could not be sent. Mailer Error: SMTP connect() failed.

kindly provide me solution.


The message indicates that cs-cart could not connect to your SMTP server. It could be either a network issue or it could be the authentication credentials you are using for your SMTP server.

Without greater detail of your SMTP email setup, hard to help beyond the obvious.

Check whether you are specifying a port or not:

Also, make sure this port is open if you are using a VPS or dedicated.

If you are trying to use Gsuite/Office 365 for smtp .. that is a whole other problem.

"Office 365 for smtp .. that is a whole other problem."

Yes it seems so...

We've been using phpMailer (on VPS server) for years then it suddenly stopped working. It looks as though SMTP is a better option anyway so we have been trying to get it working properly for a few weeks now.

It seems to work about half of the time (when clicking "notify customer") and saving the order until it gets progressively worse then won't work at all. Until the next day and it does the same thing again. When it fails we get the message "Mailer Error: SMTP connect() failed."

We're using the recommended SMTP settings for O365, e.g.

password (has been verified as correct)

Encryption connection - TLS

Use SMTP authentication - ticked

In Exchange Admin center > Settings > Mail flow > Security....

Turn on SMTP AUTH protocol for your organisation – Enabled

Turn on use of legacy TLS clients – Disabled

In Microsoft 365 admin center > Active Users > User > Mail tab > Email apps > Manage email apps > We have Authenticated SMTP ticked.

We're on V4.3.6

Any ideas?

The behavior you describe (declining access over time) would lead me to think that you need to authorize your site in Office365 to relay mail. It sounds like it is allowing it but then gets more restrictive over time. Just a guess...

Hi MrGrant,

Just wondering if you have found a fix for the SMTP error you have?

We also have the same/similar issue.

SMTP server to send emails does not work in CS-Cart. I have tested this account on a few different online testers and various devices and software to send emails out.

PHPMailer works, but I would rather use the SMTP method.

We are also using Office365 Exchange, so the same settings you have for the server. I have tried port 25 and 587 for sending.

There are no login attempts seen in the Sign-In Logs in Azure Active Directory. Not sure where else I could see logs to find out what is happening. Does CS-Cart have a place where I can look at logs that might show what is happening.?

We are running CS-Cart version 4.10.2.

Thoughts anyone?

Yes it feels like some kind of rate limiting feature, though it starts to happen on low volumes of around 10 emails.

I have a feeling it can be fixed by following the instructions here.

In the meantime we got it working with an SMTP relay service is working well and not costing anything for our email volumes.

It would be nice to have it running natively through Office 365 but I know that will take a lot of time and trial/error to get going...

Best place to start is your PHP error_log.

SMTP works fine here. But not using O365. I've seen other's with similar issues. Suggest you lookup your IP address on a Black/graylist site to see if your IP is being seen as a spammer.