Smtp Error Gmail "failed To Connect To Server: Network Is Unreachable (101)"

Hi there,

we had 2 problems with our CS Cart/Gmail account when sending emails through PHP mail function:

1) emails sent through CS Cart were always indicated as Spam

2) they were sent from vendors' addresses, instead of our marketplace main contact address

We wanted to change this by enabling SMTP connection. We set is as following:

SMTP host: mail.ourdomain.pl:465 --> Gmail port
SMTP login: our email address
SMTP password: xxxxxxxxx
Use SMTP authentication: no/yes (we tried both)
The problem now is that we cannot even save this function, since the following error is being returned: "Failed to connect to server: Network is unreachable (101)"
What are we doing wrong? I suppose it might be something on Gmail's settings side, but no idea what. We have IMAP enabled, if this matters. Did anyone have a similar problem with connecting with Gmail?
Thank you,
Paulina

Hello,

As far as I know, settings of sending e-mail through Gmail SMTP are constant.

SMTP host: smtp.gmail.com:465

SMTP user: your e-mail address

SMTP password: password to your Gmail account

Use Encrypted Connection: SSL

Use SMTP authentication: Yes

You also have to enable "Less secure apps" in your Google account settings.

https://myaccount.google.com/lesssecureapps

Best regards,

Michael

Michael, thanks for your answer. I'm afraid though that it doesn't solve the problem. When I set it according to your instruction, I'm getting an error message:

Password command failed: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentialsu27sm575190lfi.243 - gsmtp . I am sure my password is coorect.

Maybe the problem sits in "Less secure apps" settings, however, seems like I cannot enable this function - I've been searching it in my Google admin account, but the only thing I found is:

You won’t be able to turn on the less secure apps enforcement setting (it’s no longer available in the Admin console). You can still allow users to turn on or off access to less secure apps on their individual accounts. Google will turn off the less secure apps setting on individual accounts for users who stop using it.

Contrary to what is written, users cannot manage this setting - it's re-directing to admin.

Do you or anyone maybe know how to deal with this?

Best regards,

Paulina

Hello,

I think you must have uncommon configuration of your Google Account - I have went into my account and I can access it the "Less secure apps" switch without any questions or errors.

https://imgur.com/a/IUuy5AW

I think you should contact with Google support, they should be able to explain you why your account can't enable less secure apps.

Best regards,

Michael

Interesting! On my account it looks differently, I don't have this switch on/off option.

Thanks a lot for your advice Michael, I will contact Google :)

Best regards,

Paulina

I found information that since June 15 Google is limiting the ability for less secure apps (LSAs) to access G Suite account data (https://gsuiteupdates.googleblog.com/2019/12/less-secure-apps-oauth-google-username-password-incorrect.html) - and my account is G Suite indeed.

I need to solve the problem with SMTP and spam somehow anyways, therefore, my next question: does it make sense to set up a second mailbox at my hosting provider? So I would have "contact@my-domain.com" on Google (my current email) and let's say "store@my-domain.com" at hosting's, and I would use the second one for SMTP access for CS Cart? This is the only solution that comes to my mind for now, but I'm not sure if there ain't any osbtacles for this (I have my CS cart registered on "contact@my-domain.com").

Another thing is that, why CS Cart is a "less secure app" for Google - can't you make it more secure, so that Google accepts it?

Thank you in advance, best regards,

Paulina

I think your questions should be directed to Google asking why cs-cart is considered "less secure app". Given the authentication is indeed secure, not sure what they beef is. If you get a response from Big-G, I'm sure others would love to know the details.

Update: did some quick research and apparently you can control this from your Google Account:

Some apps and devices use less secure sign-in technology, which makes your account vulnerable. You can turn off access for these apps, which we recommend, or turn it on if you want to use them despite the risks. Google will automatically turn this setting OFF if it’s not being used. Learn more

You might try going to: https://myaccount.google.com/lesssecureapps

I can ask of course, just wondering if this topic has ever been checked with Google on CS Cart's side. Authentication might be not secure enough, because you need only login and password to enter the system, and they probably want authentication through phone number or something like this.

Unfortunately, the link doesn't let me switch on this function. There's written: "This setting is managed by the domain administrator". I don't know who they mean administrator is, I thought it's me but apparently not, I don't have the possibility of enabling it. And this leads me to the fact that they disabled it for G Suite.

This is why I wanted to create another mailbox for SMTP, but don't know it it will work technically.

If you read their documentation, it's all geared toward "apps" and they prefer login to be via Google. Suggest you just change the settings for your business account. You might have to access it after logging in. I was enabled for me but I did not provide the parameters since that would obviously expose me.

OK, I talked with Google and the problem has been solved - turned out I had some uncommon account settings. Enabling less secure apps helped, however it was hard to find this feature on my account (it was invisible, "covered" by some temporary information).

Guys, thank you so much for your attention and help.

Best regards,

Paulina

I have fresh install and using Zoho. Smtp is working outside of cs-cart, but it is not working when put in cs-cart Settings > Emails. Please can anyone tell me the fix for this? Script is not linking to smtp.

OK, I talked with Google and the problem has been solved - turned out I had some uncommon account settings. Enabling less secure apps helped, however it was hard to find this feature on my account (it was invisible, "covered" by some temporary information).

Guys, thank you so much for your attention and help.

Best regards,

Paulina

Hello,
I have a probleme with SMTP mail, and i can' find a solution.
Gmail is configured correctly in admin (smtp.gmail.com, mail, pass), I generated a new App password, but I still get this error:
"ErrorMessage could not be sent.
Mailer Error: SMTP connect() failed. https://github.com/P...oubleshooting".
Does anyone have a solution to this problem?
Thank you, Alex