I was trying to set up a gmail account for email and it doesn’t seem to work. It’s giving error messages.
I have turned on access to less secure apps in gmail.
I am able to use smtp successfully outside dolibarr.
Below are the errors.
PHP mail function
Server is not available at address localhost on port 25 - Error 10061 - No connection could be made because the target machine actively refused it.
SMTP/SMTPS socket library
Server is not available at address localhost on port 587 - Error 10061 - No connection could be made because the target machine actively refused it.
Hi bro!
I saw the setting is fine. But the sender and receiver are same email address. Maybe smtp google refused it. Can you try again with different receiver email?
I don’t think you can use self signed cer when contacting to smtp google. Your cert need to be verified from trusted CA. In that case, you can try with smtp mail server has less secure.
Servus sac!
I’m not experienced with coupling Dolibarr and gmail, but my configuration
has “TLS (STARTTLS) encryption” activated instead of “TLS (SSL) encryption” in your case.
Furthermore my SMTP/SMTPS Port is set to 587 which refers to the encrypted version of SMTPSecure.
This is of course in accordance with my personal webspace and email hoster, so google may demand other settings.
Otherwise I have nearly the same environment as you have, except that I’m running my local Dolibarr on Linux.
And there’s no HTTPSecure required, so no need for certificates with the local installation.
I tried TLS but still there is error,
Error [132]: STARTTLS connection failed. Error [121]: Couldn’t get mail server response codes Error [120]: Ran into problems sending Mail. Response:
I did exactly as said there and yet I get the error message. I also tried using an outlook account to check if it is a Gmail specific problem. But I faced the same error in outlook too.
Log in to your Gmail account through a web browser and enable access through less secure apps . Less secure apps can make your account more vulnerable, Google will automatically turn this setting off if it’s not being used. However, bypass this security setting with a configuration tweak within your Google Email Account .
Enabling access for “less secure apps” means that the client/app doesn’t use OAuth 2.0 . OAuth 2.0 is the industry-standard protocol for authorization. When you sign in with OAuth 2.0, you sign in to Google’s system directly. In OAuth 2.0 , you authenticate directly to Gmail with your credentials and authorize an app to do certain things. The third-party app only sees an authorization token provided by Google as proof that you authenticated correctly and agreed to authorize that app.
If I am not mistaken, the feature “less secure apps” (i.e. using your regular password for external logins) has been removed by Google recently. But there is still an alternative option: in your account you can go to → Security and from there to “App passwords”. There you can assign a specific password to log in from an external application. Just make sure you use this password, when you login from this app.
I looked and looked for the App passwords, but I did not see it until I enabled 2-factor, because google also says:
" Sign in with app passwords
Tip: App passwords aren’t recommended and are unnecessary in most cases. To help keep your account secure, use “Sign in with Google” to connect apps to your Google Account.
An app password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App passwords can only be used with accounts that have [2-Step Verification](Turn on 2-Step Verification - Computer - Google Account Help) turned on."