Page 1 of 2
SMTP Mail Error
Posted: Fri Nov 10, 2017 4:32 pm
by stashdesign
I can't get the SMTP function to work. I have tried different mail accounts but have no luck.
Mail settings is:
Mail Engine: SMTP
Mail Parameters: Blank (Have tried -f email)
SMTP Hostname: ssl://smtp.domain.com
SMTP Username:
mail@domain.com
SMTP Password: Password
SMTP Port: 465
SMTP Timeout: 5
Just getting error. If i change Mail Engine to mail i have no problems. Bu i want to use SMTP.
Please help out with this.
Re: SMTP Mail Error
Posted: Fri Nov 10, 2017 10:20 pm
by cheing
try to remove your ssl: at hostname.
if your domain to access email is
https://mail.domain.com
just put mail.domain.com
you can use the login information to access on webmail to make sure your login info is correct
Re: SMTP Mail Error
Posted: Fri Nov 10, 2017 10:35 pm
by straightlight
Just getting error. If i change Mail Engine to mail i have no problems. Bu i want to use SMTP.
Please help out with this.
What are the error messages?
Re: SMTP Mail Error
Posted: Sat Nov 11, 2017 1:40 am
by pom
It seems to be a common problem and probably due to server configurations.
I posted last week about my same problem...
viewtopic.php?f=202&t=199341
I still haven't figure it out but using gmail as a temporary solution works perfectly.
Re: SMTP Mail Error
Posted: Fri Nov 17, 2017 2:36 pm
by stashdesign
Okay. I have tried all possible settings i can think of. I have allso verified smtp-settings. Now i have tried with a fresh installation on Ubuntu server with apache and PHP5, and also on ubuntu server with Nginx and PHP7. I can't get this to work. The "Mail" protocol will work, but not SMTP. I want to use SMTP.
The last error message i get in the servers "/var/log/nginx/error.log" is:
Code: Select all
2017/11/17 07:35:01 [error] 27956#27956: *118 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Exception: Error: DATA not accepted from server! in /var/www/prod/webshop.restaurantpartner.no/files/system/library/mail/smtp.php:328
Stack trace:
#0 /var/www/prod/webshop.restaurantpartner.no/files/system/library/mail.php(142): Mail\Smtp->send()
#1 /var/www/prod/webshop.restaurantpartner.no/files/catalog/controller/information/contact.php(25): Mail->send()
#2 /var/www/prod/webshop.restaurantpartner.no/storage/modification/system/engine/action.php(79): ControllerInformationContact->index()
#3 /var/www/prod/webshop.restaurantpartner.no/files/catalog/controller/startup/router.php(25): Action->execute(Object(Registry))
#4 /var/www/prod/webshop.restaurantpartner.no/storage/modification/system/engine/action.php(79): ControllerStartupRouter->index()
#5 /var/www/prod/webshop.restaurantpartner.no/files/system/engine/router.php(59): Action->execute(Object(Registry))
#6 /var/www/prod/webshop.restaurantpartner.no/files/system/engine/router.php(52): Router->execute(Object(Actio" while reading response header from upstream, client: 77.241.102.18, server: webshop.restaurantpartner.no, request: "POST /index.php?route=information/contact HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "webshop.restaurantpartner.no", referrer: "https://webshop.restaurantpartner.no/index.php?route=information/contact"
2017/11/17 07:35:01 [error] 27956#27956: *125 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function imap_open() in /var/www/prod/office.kraftweb.no/application/libraries/peeker_connect.php:74
Re: SMTP Mail Error
Posted: Fri Nov 17, 2017 8:29 pm
by straightlight
Followed are steps to install IMAP:
https://stackoverflow.com/questions/965 ... pen-in-php . If you do not have access, contact host support to resolve this issue. An alternative way to set-up your email with Opencart would be with Gmail.
Re: SMTP Mail Error
Posted: Sun Nov 19, 2017 1:09 am
by stashdesign
I don't need IMAP to work, but the STMP. Also tried to setup SMTP with Gmail, but same error with that. Again, the mail protocol is working, but not the STMP in opencart. I don't want to use the Mail protocol in OpenCart (sending mail from server) but the SMTP.
I can see that i am not the only one that have problems with this, but i have not yet find a fix.
Re: SMTP Mail Error
Posted: Sun Nov 19, 2017 1:14 am
by straightlight
In the mail parameters, by using SMTP, use the -f parameter without space before and after your entered parameter in the admin - > system - > settings - > edit settings - > mail tab. If the results are the same afterwards, try with Gmail. Otherwise, as mentioned above, contact host support to resolve this issue in order to know what are the right parameters for your email configuration.
Re: SMTP Mail Error
Posted: Sun Nov 19, 2017 2:23 am
by stashdesign
I have finally fixed the problem. Now it works with gmail, zohomail and other tested mails.
I did not know that OpenCart require you to use same mail address in the store email address as in the smtp username address.
But if you want to reccive emails that was sent from the "Contact us" page in another email that you use as sender in SMTP you have to change som code.
The fix is working on my version 3.0.2.0.
----
Settings in your admin (System/Settings/Store)
Input the email address that you want to recieve email sent from "Contact Us" page.
Settings in (System/Settings/Mail)
Mail Engine: SMTP
Mail Parameters: Blank
SMTP Hostname: tls://smtp.zoho.com
SMTP Username:
shop@exampledomain.com
SMTP Password: ************
SMTP Port: 587
SMTP Timeout: 10
Change in code (Your-OpenCart-Install-Root/system/library/mail/smtp.php)
Change line 24 and 32.
From:
Code: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
$header .= 'Return-Path: ' . $this->from . PHP_EOL;
To:
Code: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->smtp_username . '>' . PHP_EOL;
$header .= 'Return-Path: ' . $this->smtp_username . PHP_EOL;
Re: SMTP Mail Error
Posted: Sun Nov 19, 2017 3:06 am
by straightlight
Take note that the above suggestion may also be per-server specifics.
Re: SMTP Mail Error
Posted: Sun Nov 19, 2017 6:13 am
by victorj
if on cpanel hosting change
SMTP Hostname: tls://smtp.zoho.com to
SMTP Hostname: mail.zoho.com
use smtp port 25
From website to mail server is a internal routing on your server so no need to use any tls protocol
normally in your hosting account you can find how to configure mail settings, but above should work
Re: SMTP Mail Error
Posted: Mon May 07, 2018 9:49 pm
by ohmashoes
Please help. I am still unable to receive email of new orders or registrations.
When I send via Contact Us, below is the error I am getting
OpenCart V3.0.2
Re: SMTP Mail Error
Posted: Mon Sep 03, 2018 3:43 pm
by Wellington Queiroz
Hey, guys!
First of all I apologize for my english hahaha
http://www.mediafire.com/?d56yuyyku1udy
Please try the following:
Download the mail.php file that I left available. Open mail.php in a text editor, such as Sublime Text, for example. Change line 119 by email and store name. Save the mail.php file in the system / library folder. After that, your customers should already be receiving mail if the SMTP settings are correct. I use Amazon AWS SES and it works perfectly. The next step is to solve the problem of the contact form. To do this, we need to access the catalog / controller / information folder and replace the contact.php file with the new one available for download. Okay, that worked. Please leave your comment if it is working for you.
Thank you.
Re: SMTP Mail Error
Posted: Mon Sep 03, 2018 6:56 pm
by straightlight
Take note that the above changes is server-specific only as the reported issue may not be reflected on other servers.
Re: SMTP Mail Error
Posted: Wed Dec 26, 2018 6:52 am
by insurenow
SMTP still not working and Nothing happens beacuse the above method is just redirecting smtp to mail
Re: SMTP Mail Error
Posted: Fri Aug 16, 2019 7:55 pm
by printingdwarfs
stashdesign wrote: ↑Sun Nov 19, 2017 2:23 am
I have finally fixed the problem. Now it works with gmail, zohomail and other tested mails.
I did not know that OpenCart require you to use same mail address in the store email address as in the smtp username address.
But if you want to reccive emails that was sent from the "Contact us" page in another email that you use as sender in SMTP you have to change som code.
The fix is working on my version 3.0.2.0.
----
Settings in your admin (System/Settings/Store)
Input the email address that you want to recieve email sent from "Contact Us" page.
Settings in (System/Settings/Mail)
Mail Engine: SMTP
Mail Parameters: Blank
SMTP Hostname: tls://smtp.zoho.com
SMTP Username:
shop@exampledomain.com
SMTP Password: ************
SMTP Port: 587
SMTP Timeout: 10
Change in code (Your-OpenCart-Install-Root/system/library/mail/smtp.php)
Change line 24 and 32.
From:
Code: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
$header .= 'Return-Path: ' . $this->from . PHP_EOL;
To:
Code: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->smtp_username . '>' . PHP_EOL;
$header .= 'Return-Path: ' . $this->smtp_username . PHP_EOL;
Thank you very much for sharing the fix. I've spent 3 days to find out that SMTP problem exists on my shop because my SMTP and Store emails were different.
Re: SMTP Mail Error
Posted: Sat Aug 17, 2019 7:50 am
by straightlight
As of PHP v7.2.4, and above, Unicode languages with emails should support universal parsing methods compared as before. You could also try the Github version on the Opencart namespace in the Pull Request section the recent modified mail class regarding UTF-8 Unicode if the problem persists. This should definitely fixed the problem as it also works with Gmail without issues.
Re: SMTP Mail Error
Posted: Sun Jan 26, 2020 12:29 am
by insurekenya
The solution is easy but tricky. In order to solve SMTP problem just use the settings below but interchange the ports between 25 (tls port), 465 (ssl port) and 587 (tls port) this is becuase some servers block either one or two of these ports 25, 465 and 587. So try all ports in order to find which port serves you.
Mail settings is:
Mail Engine: SMTP
Mail Parameters: Blank (Have tried -f email)
SMTP Hostname: use tls or ssl://smtp.domain.com
SMTP Username:
mail@domain.com
SMTP Password: Password
SMTP Port: try these ports one after the other (465, 587 or 25)
SMTP Timeout: 5

Re: SMTP Mail Error
Posted: Sun Jan 26, 2020 2:09 am
by letxobnav
So try all ports in order to find which port serves you
Tricky indeed.
Port 25 is not tls.
And you need not put tls:// in the hostname as the smtp class strips that out anyway.
Re: SMTP Mail Error
Posted: Thu Feb 04, 2021 3:04 pm
by roro111
sending a newsletter is returning with an error 'error_email', as soon as i pressed the send button. The contact form on the contact page is working just fine. I am just unable to use the newsletter feature. I contacted the host and they said:
"I would like to let you know that this issue appears to be Opencart related and in order to resolve it please consider following one of the mentioned in the following thread solutions:
viewtopic.php?t=199510"
Which I tried with multiple settings option in "mail setting" without success. Can I get some help?
Thanks