Custom email server (transport) with Magento
13 Comments 12th MAR 2010 | Posted by Branko Ajzele in Magento

Magento has quite interesting email sending capabilities. However, those are more in terms of email templates then selecting a non-built in email server. Sometimes, your web hosting might have separate mail server and even the simple php send mail does not work. In such cases you are forced to use an external mail server that supports SMTP. Good example of this is a Gmail.
So, how do we “switch” our Magento to use Gmail? Here is a small extension I wrote for my self. Figured why not give it away.
Download Ajzele_MailTransport extension.
And here is a little screenshot that shows the available config options.
As always, use at your own risk
To post code in comments, place your code inside [code] and [/code] tags.




















March 12th, 2010 at 19:47
Hello,
I install and gote this message when use the contact us: Unable to submit your request. Please, try again later
and the port? that is not supost to have a setup option for you put the port for gmail?
thank you,
Darley
March 13th, 2010 at 0:41
A heads-up, a site I took over which was not developed by me, using a popular Gmail extension, recently, client reported a number of customers couldn’t do the checkout at the last Review step, but a few were able to during the same period. I only got a chance to look into the issue late at night after the site came back to normal, couldn’t find anything except in the report folder, there were some 35 reports related to that Gmail extension, the date and hours match the checkout issue customers ran into.
I weren’t able to replicate the problem but pretty sure it was caused by Google mail server, it appeared that Google mail server had connection issue during those hours, and Magento was not able to receive a notification; one persistent customer tried to checkout a 3 times and the third went through, somehow his email was not being recorded (how could this ever happened still is a big puzzle to me) which resulted client not able to send a comment to him (client was not aware that missing email was the issue), to add insult to injury, the server had a sql connection issue in the same day – this three issues caused a big panic.
I am still not sure how could that Google mail server connection issue causing checkout not being able to execute, shouldn’t it be that cilent and customer not able to receive order email only?!
March 14th, 2010 at 6:53
This is the very thing I’m looking for, thanks!
Also here is an old thread from Magento Forum of discussing the similar thing: http://www.magentocommerce.com/boards/viewthread/1073/
March 15th, 2010 at 22:20
how do I install this? I transfer all the file under community. But it doesn’t do anything. I did refresh cache as well.
Thanks,
JC
March 19th, 2010 at 21:21
Will this work in 1.3.2.4?
March 20th, 2010 at 14:06
Hello i get error
Undefined class constant ‘XML_PATH_SENDING_SET_RETURN_PATH’
at $setReturnPath = Mage::getStoreConfig(self::XML_PATH_SENDING_SET_RETURN_PATH);
here should be
$setReturnPath = Mage::getStoreConfigFlag(Mage_Newsletter_Model_Subscriber::XML_PATH_SENDING_SET_RETURN_PATH);
But these settings are in fact belong to the newsletter?
————-
? ?????????
March 31st, 2010 at 14:19
My site it´s still in test, obviously
I have the same error as Darley Cassimiro.
When I use the contact form, I get the message: Unable to submit your request. Please, try again later
March 31st, 2010 at 15:01
Just found another extension from Magento Connect for similar purpose, hope this is helpful to you guys:
http://www.magentocommerce.com/extension/1326/aschroder.com-google-apps-email-gmail
May 18th, 2010 at 22:33
I have some issues with this extension in Magento 1.4.0.1
May 19th, 2010 at 2:12
I take it back. It works in Magento 1.4.01. Just make sure to delete the cache after install
May 19th, 2010 at 2:13
Bit thank you to the author for making it available
July 2nd, 2010 at 3:28
Dema501 already mentioned the error:
Undefined class constant ‘XML_PATH_SENDING_SET_RETURN_PATH’
This comes up because this plugin is developed for 1.4 and breaks for versions below. To fix it just add the following:
const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path';
const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email';
in class Ajzele_MailTransport_Model_Core_Email_Template after line:
' const MODULE_SETTINGS_PATH = 'ajzele_mail_transport';
I hope it helps
July 3rd, 2010 at 1:08
For Magento version 1.2.1.1 I was getting error that Zend_Validate_Hostname_Com class does not exist when orders were placed and emails were not send neither when orders placed nor when orders invoiced
I followed a post online where the solutions was to copy/rename Zend_Validate_Hostname_De to Zend_Validate_Hostname_Com. It worked for me and know emails is being sent
I looked in mangeto version 1.4 and there is class Zend_Validate_Hostname_Com and that’s probably why this plugin worked right the way for magento version 1.4