Magento – Connection refused error while sending order confirmation mail

emailmagento-1.9smtp

My magento admin dashboard says that the order confirmation mail has been successfully send, but I am not getting any mail in my inbox, and the exception.log file says this

exception 'Zend_Mail_Protocol_Exception' with message 'Connection refused' 
in /lib/Zend/Mail/Protocol/Abstract.php:277
Stack trace:
#0 /lib/Zend/Mail/Protocol/Smtp.php(167) Zend_Mail_Protocol_Abstract->_connect('tcp://smtp.secu...')
#1 /lib/Zend/Mail/Transport/Smtp.php(199): Zend_Mail_Protocol_Smtp->connect()
#2 /lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#3 /lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#4 /app/code/local/Mage/Core/Model/Email/Template.php(460): Zend_Mail->send()
#5 /app/code/local/Mage/Core/Model/Email/Template.php(517): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#6 /app/code/core/Mage/Core/Model/Email/Template/Mailer.php(84): Mage_Core_Model_Email_Template->sendTransactional('1', 'support', Array, Array, Array, '1')
#7 /app/code/core/Mage/Sales/Model/Order.php(1354): Mage_Core_Model_Email_Template_Mailer->send()
#8 /app/code/core/Mage/Sales/Model/Order.php(1369): Mage_Sales_Model_Order->queueNewOrderEmail(true)
#9 /app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(139): Mage_Sales_Model_Order->sendNewOrderEmail()
#10 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_OrderController->emailAction()
#11 /app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('email')
#12 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#14 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /index.php(83): Mage::run('', 'store')
#16 {main}

I have set up my host as smtp.secureserver.net and the port is 25. I have copied the template.php file in the app>code>core>mage>core>model>email to my local directory and edited the getmail(). I would also like to mention that in the template.php file below the send() in this line:

if (!($this->hasQueue()) && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

The above line generates an exception in the exception.log file but the original code which was this

 if (($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

doesn't generates any error in the log file. Please help, thanks in advance

Best Answer

"Connection refused" implies there is a problem with the connection, likely either caused by secureserver.net or your own server.

I would try switching either to port 3535 or 587 (TLS / Secure port) to see if that resolves the issue. If that does not work, check your local firewall settings and make sure outgoing connections via these ports are permitted.

In any case, the issue is likely not to be found on Magento's end.

Related Topic