'SMTP "Error: DATA not accepted from server!" Opencart 2.3 on InMotionHosting

I've installed a brand new Opencart 2.3.0.2 on Inmotionhosting with all default settings except MAIL settings which I've tried many different combinations. Although it shows the "Error: DATA not accepted from server!", but it sends mail successfully!

Hosting support center says that all everything is OK, so it should be a coding issue!

Mail Setting:

Mail Protocol: SMTP
Mail Parameters: [email protected]
SMTP Hostname: mail.mywebsite.com
SMTP Username: [email protected]
SMTP Password: ********
SMTP Port: 587
SMTP Timeout: 5

Full Error details:

Fatal error:  Uncaught exception 'Exception' with message 'Error: DATA not accepted from server!' in /home/mywebsite/public_html/mywebsite.com/oc/system/library/mail.php:409
Stack trace:
#0 /home/mywebsite/public_html/mywebsite.com/oc/catalog/model/account/customer.php(81): Mail->send()
#1 [internal function]: ModelAccountCustomer->addCustomer(Array)
#2 /home/mywebsite/public_html/mywebsite.com/oc/system/engine/loader.php(178): call_user_func_array(Array, Array)
#3 [internal function]: Loader->{closure}(Array, Array)
#4 /home/mywebsite/public_html/mywebsite.com/oc/system/engine/proxy.php(25): call_user_func_array(Object(Closure), Array)
#5 /home/mywebsite/public_html/mywebsite.com/oc/catalog/controller/account/register.php(21): Proxy->__call('addCustomer', Array)
#6 /home/mywebsite/public_html/mywebsite.com/oc/catalog/controller/account/register.php(21): Proxy->addCustomer(Array)
#7 [internal function]: ControllerAccountRegister->index()
#8 /home/mywebsite/public_html/mywebsite.com/oc/system/engine/action.php(51): call_user_func_array(Array, Array)
#9 /home/sabour in /home/mywebsite/public_html/mywebsite.com/oc/system/library/mail.php on line 409

Any idea how to get rid of this error?



Solution 1:[1]

I have commented above, but if this does not fix your issue, there is a series of config steps to work through below:

Here is the complete article which I obtained from:

https://opencartforum.com/topic/23861-resheno-yandex-takoy-yandex-ne-otpravlyayutsya-pisma-vydaet-oshibku-data-not-accepted-from-server/?page=2

Opencart 2.0+ fix

First edit the file catalog / controller / information / contact.php Look for line:

$ Mail-> setFrom ($ this-> request-> post [ 'email']);

Change it to:

$ Mail-> setFrom ($ this-> config-> get ('config_email'));

What this will do is set the FROM field to be the same as your shop's main email address.

Now find this line:

$ Mail-> setSender ($ this-> request-> post ['name']);

Change it to:

$ Mail-> setReplyTo ($ this-> request-> post ['email']);
$ Mail-> setSender ($ this-> config-> get ('config_email'));

Now we need to edit system / library / mail.php file You just need to change one line:

$ Header = 'Reply-To:? = UTF-8 B??'. . base64_encode ($ this-> replyto). '='. '<'. $ This-> from. '>'. $ This-> newline;

change it to:

$ Header = 'Reply-To:? = UTF-8 B??'. . base64_encode ($ this-> replyto). '='. '<'. $ This-> replyto. '>'. $ This-> newline;

There is also a similar issue here:

phpmailer - The following SMTP Error: Data not accepted

Solution 2:[2]

SOLVED!

In my case, the problem was SMTP HOSTNAME which actually should be the primary domain name of the shared host, not the add-on domain.

Mail Protocol: SMTP
Mail Parameters: [email protected]
>>> SMTP Hostname: mail.primary-domain.com <<<
SMTP Username: [email protected]
SMTP Password: ********
SMTP Port: 587
SMTP Timeout: 5

I wonder why live support of InmotionHosting.com didn't realise this!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Kardo