Post by matheusalxandre » Wed Apr 19, 2017 3:04 am

Hi everyone,

I know that's a lot of topics about this, but I cant find one that solve my problem, I really search, but cant find a solution, if you can help me I will be very glad:

I'm trying to use SMTP on my website, but fail everytime I try to send a email.

The error -> Warning: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) in /home/vhosts/www.mysite.com/system/library/mail.php on line 167

I'm using cloudflare on my website, to https.
Cludflare setup with gmail MX records, and CNAME with name = "mail" and value = ghs.google.com (Gray option active)
I'm using gmail (using godady to .com, and configured on gmail on port 465 SSL as a aliass).
Gmail less secure apps disabled (also tried enabled)
Gmail two steps verification disabled (also tried enabled, and also tried use app password of the gmail on opencart SMTP Password )
Contacted the host, ports 25, 465, 587 are open, and I can use SMTP.

I'm using the following setup on opencart

Mail Protocol: SMTP
Mail Parameter: -fmysite@mail.com (also tried blank)
SMTP Hostname: ssl://smtp.gmail.com (also tried: smtp.gmail.com , tls://smtp.gmail.com )
SMTP Username: mysite@mail.com
SMTP Password: My Gmail password
SMTP port: 465 (also tried: 25, 587)
Timeout: 5 (also tried: 7, 60, 200)

Already tried with outlook, zohoo, but the same problem.

I dont want to use Mail Protocol: MAIL, because this way, all emails go to SPAM folder.

Using the port 25 I get the error -> fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in /home/vhosts/www.mysite.com/system/library/mail.php on line 167Warning: fsockopen(): Failed to enable crypto in /home/vhosts/www.mysite.com/system/library/mail.php on line 167Warning: fsockopen():

My opencart version 2.3.0.2

Please Help Me :-[

PS english is not my native language, sorry.


Posts

Joined
Wed Apr 19, 2017 2:26 am

Post by maxigallo76 » Sat May 20, 2017 12:43 am

1. Login to your Opencart Admin Page and navigate to System > Settings > Edit > Mail
2. Once you have opened up the Mail Settings tab you should complete the form using the following data:
Mail Protocol should be set to SMTP
Mail Parameters is an optional field we will not be discussing. You can leave it blank for now.
SMTP Host should be set to “ssl://smtp.gmail.com”
It is very important you include “ssl://” or your customers will receive errors when completing actions on your store that use the mail feature.
SMTP Username should be set to the account username for the Gmail account you would like to use. “yourusername@gmail.com
SMTP Password should be the corresponding password for your Google Account
SMTP Port should be “465"
This is also important as it’s a great feature of Google’s SMTP service. As it does not use port 20 it keeps your emails from being marked as spam.
SMTP Timeout you can leave set to the default of 5.
The alert email options can be turned on if you would like the store owner to be emailed every time an account is created or an order is processed. They are turned off by default and I suggest leaving them this way, especially if your store has a high volume of orders. These emails are sent to the email account specified from the General tab on the same settings page you are on now.
The additional alert email fields just specify other email address that you would like these alerts to be sent to if you did have them turned on.
That is all that must be completed from the Opencart admin. You can now hit save and move on to the next step.
3. Go to Gmail and login to the account that you used for your SMTP configuration in Step 2.
Once logged in, go to “https://accounts.google.com/b/0/DisplayUnlockCaptcha"
Click continue. This will authenticate the next app or device that tries to access your Gmail Account within the next 10 minutes.
Now you must go to your Opencart store front end and register for a new account. When this is done Opencart will attempt to access your Gmail Account for SMTP and Google will Authenticate it.
You should be sent to a confirmation page that your account was created on your site, and an email should be sent to your email address you used to register your account, using your Google SMTP configuration.
That’s it! You’re all set up!
If you receive any errors, make sure you completed step 3 to have your store authenticated with Google, as well as used ssl:// before your hostname in the Opencart admin mail settings.

Newbie

Posts

Joined
Fri May 19, 2017 10:43 pm

Post by jepi » Wed Oct 18, 2017 4:50 pm

maxigallo76 wrote:
Sat May 20, 2017 12:43 am
1. Login to your Opencart Admin Page and navigate to System > Settings > Edit > Mail
2. Once you have opened up the Mail Settings tab you should complete the form using the following data:
Mail Protocol should be set to SMTP
Mail Parameters is an optional field we will not be discussing. You can leave it blank for now.
SMTP Host should be set to “ssl://smtp.gmail.com”
It is very important you include “ssl://” or your customers will receive errors when completing actions on your store that use the mail feature.
SMTP Username should be set to the account username for the Gmail account you would like to use. “yourusername@gmail.com
SMTP Password should be the corresponding password for your Google Account
SMTP Port should be “465"
This is also important as it’s a great feature of Google’s SMTP service. As it does not use port 20 it keeps your emails from being marked as spam.
SMTP Timeout you can leave set to the default of 5.
The alert email options can be turned on if you would like the store owner to be emailed every time an account is created or an order is processed. They are turned off by default and I suggest leaving them this way, especially if your store has a high volume of orders. These emails are sent to the email account specified from the General tab on the same settings page you are on now.
The additional alert email fields just specify other email address that you would like these alerts to be sent to if you did have them turned on.
That is all that must be completed from the Opencart admin. You can now hit save and move on to the next step.
3. Go to Gmail and login to the account that you used for your SMTP configuration in Step 2.
Once logged in, go to “https://accounts.google.com/b/0/DisplayUnlockCaptcha"
Click continue. This will authenticate the next app or device that tries to access your Gmail Account within the next 10 minutes.
Now you must go to your Opencart store front end and register for a new account. When this is done Opencart will attempt to access your Gmail Account for SMTP and Google will Authenticate it.
You should be sent to a confirmation page that your account was created on your site, and an email should be sent to your email address you used to register your account, using your Google SMTP configuration.
That’s it! You’re all set up!
If you receive any errors, make sure you completed step 3 to have your store authenticated with Google, as well as used ssl:// before your hostname in the Opencart admin mail settings.
I followed your steps, but It's still show Error: Password not accepted from server!, any another idea? like changing the code or anything else?

Newbie

Posts

Joined
Thu Sep 14, 2017 5:38 am

Post by webcorvo » Wed Oct 18, 2017 6:23 pm

Hi matheusalxandre,

You have make all configurations fine: the SMTP port should be 587

Mail Protocol: SMTP
Mail Parameter: blank
SMTP Hostname: ssl://smtp.gmail.com
SMTP Username: mysite@mail.com
SMTP Password: My Gmail password
SMTP port: 587
Timeout: 5
Last edited by webcorvo on Wed Oct 18, 2017 6:45 pm, edited 2 times in total.

Opencart Developer, custom work and support.
Contact - webcorvo@gmail.com


User avatar
Active Member

Posts

Joined
Mon Mar 20, 2017 11:42 pm
Location - Lisbon, Portugal

Post by jepi » Wed Oct 18, 2017 6:36 pm

webcorvo wrote:
Wed Oct 18, 2017 6:23 pm
Hi matheusalxandre,

You have make all configurations fine: the SMTP port should be 587

Mail Protocol: SMTP
Mail Parameter: blank
SMTP Hostname: ssl://smtp.gmail.com
SMTP Username: mysite@mail.com
SMTP Password: My Gmail password
SMTP port: 587
Timeout: 5

Try to delete the cache and try again ;)
Hello webcorvo, I had follow your step with SMTP port : 587 and get this error :

Code: Select all

Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in 
Just want to make sure, is the SMTP username (email) can be private email? like own email : jep@gmail.com not the host email or company email?

P.S : my opencart version is 3.0.2

Newbie

Posts

Joined
Thu Sep 14, 2017 5:38 am

Post by webcorvo » Wed Oct 18, 2017 6:44 pm

yes, must be the user name and pwd of gmail ;)

Opencart Developer, custom work and support.
Contact - webcorvo@gmail.com


User avatar
Active Member

Posts

Joined
Mon Mar 20, 2017 11:42 pm
Location - Lisbon, Portugal

Post by jepi » Thu Oct 19, 2017 6:17 am

webcorvo wrote:
Wed Oct 18, 2017 6:44 pm
yes, must be the user name and pwd of gmail ;)
I make sure that, I had input the correct username and password of gmail, still error

Newbie

Posts

Joined
Thu Sep 14, 2017 5:38 am

Post by straightlight » Thu Oct 19, 2017 6:35 am

See if this demonstration is working for you but by entering your configurations: viewtopic.php?t=87368#p542817

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Guru Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: PhantomMenace, rikmg67 and 60 guests