Home » Php » opencart mail trigger return error

opencart mail trigger return error

Posted by: admin October 26, 2017 Leave a comment

Questions:

I am using opencart 2 and my server is amazon aws.
from opencart setting, I have added mail setting like mail_protocol, host, user and password. my mail protocol is smtp. it was working before, but now when I am trying to send mail, it is throughing an error.

Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opt/lampp/htdocs/haute-horologe/system/library/mail.php on line 175Warning: fsockopen(): unable to connect to :25 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /opt/lampp/htdocs/haute-horologe/system/library/mail.php on line 175
Fatal error: Uncaught exception ‘Exception’ with message ‘Error: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)’ in /opt/lampp/htdocs/haute-horologe/system/library/mail.php:178 Stack trace: #0 /opt/lampp/htdocs/haute-horologe/catalog/model/checkout/enquiry.php(50): Mail->send() #1 [internal function]: ModelCheckoutEnquiry->saveEnquiry(Array) #2 /opt/lampp/htdocs/haute-horologe/system/storage/modification/system/engine/loader.php(178): call_user_func_array(Array, Array) #3 [internal function]: Loader->{closure}(Array, Array) #4 /opt/lampp/htdocs/haute-horologe/system/engine/proxy.php(25): call_user_func_array(Object(Closure), Array) #5 /opt/lampp/htdocs/haute-horologe/catalog/controller/checkout/cart.php(284): Proxy->__call(‘saveEnquiry’, Array) #6 /opt/lampp/htdocs/haute-horologe/catalog/controller/checkout/cart.php(284): Proxy->saveEnquiry(Array) #7 [internal function]: ControllerCheckoutCart->index() #8 /opt/lampp/htdocs/haute-horologe/system/storage/modification/system/engine/action.php(51) in /opt/lampp/htdocs/haute-horologe/system/library/mail.php on line 178

this is mail file

please help me, I am not getting the solution.
one more thing. If I am using mail protocol then mail is not going and error is not throughing . but when i am using smtp protocol, then mail is not going, and error is throughing.

Answers: