Page 1 of 1

Sending mail from localhost using gmail smtp

Posted: Fri Apr 07, 2017 11:22 am
by snahasish89
Hi Forum,

I am new in opencart. I am not able to send mail from localhost in my machine.

Here is my configuration for mail in Setting->Store->Mail tab.
Mail Protocol: smtp
Hostname: ssl://
username: <my gmail username>
password:<my gmail password>
port: 465
timeout: 25

When I complete an order (Sale->Orders-> Save(Totals tab)), Its getting error that "Error:EHLO not accepted from server"

My requirement is I want to send mail with above configuration from localhost.

System Configuration is: Win 32/ opencart 5

Please help.

Re: Sending mail from localhost using gmail smtp

Posted: Sat May 20, 2017 12:45 am
by maxigallo76
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://”
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. “
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 “"
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.

Re: Sending mail from localhost using gmail smtp

Posted: Tue Nov 07, 2017 8:32 pm
by magiczabata
you will easily send you mails through

gmail sign in

Re: Sending mail from localhost using gmail smtp

Posted: Wed Nov 29, 2017 7:05 pm
by magicramzy
Thanks for this post!!
gmail login

Re: Sending mail from localhost using gmail smtp

Posted: Sat Dec 02, 2017 4:36 pm
by hemsopheak
I have to follow your instruction, but i got internal server error, could i have more detail or screen shot guideline please?

Re: Sending mail from localhost using gmail smtp

Posted: Fri May 08, 2020 6:23 am
by apcsbz
Getting the following error when using SMTP for contact us form
Warning: fsockopen(): unable to connect to ssl:// (Connection refused) in /home/f4p5edul7coa/public_html/system/library/mail/smtp.php on line 87
I use and tried with ssl://
I also put port 465 and also tried 587 none of them work
the mail option give no error but no email is received.
I get email only when a user is registered.
please help