Posted on

Magento SMTP, Gmail and Google Apps Email combined extension released (at last)

I have finally finished my Magento SMTP, Gmail and Google Apps Email combined extension. It will be available on Magento Connect shortly (as soon as Varien fix the little bugs in the ‘submit extension’ interface – namely version and stability appear to be required and missing from the form.

I won’t bore you with the details again – but I have tested this working on version 1.4 of Magento (along with 1.2 and 1.3 as always). So for those of you having trouble with email on Magento 1.4 – give this alpha release of my SMTP, Gmail and Google Apps email Magento extension a go. Please note it is a development release, and you should definitely not install it on a production site without first testing it in your development environment.

With this extension you can:

  1. Use Magento with your choice of SMTP server, port and authentication/encryption schemes
  2. Use Magento with Gmail or Google Apps Email very easily

Please download it and test it out, let me know any feedback you may have.

Update: Thanks to Paulius there is a specially packaged version of the extension that will make it easy to install manually until I can get the Magento Connect version updated (which is still failing). Get it here!

88 thoughts on “Magento SMTP, Gmail and Google Apps Email combined extension released (at last)

  1. Hello Ashley,

    I have uploaded all files to my server and double checked the paths. I filled in all the information in the back-end and tested the Contact Us link. However I get the following error “Unable to submit your request. Please, try again later”. I also tried to run the self test and it redirects me to my index. Do the settings under Configuration>System>Mail Sending Settings affect this at all? I have also flushed the Magento cache after updating the settings. I am using Magento ver. 1.4.0.1. Any ideas? Thanks

  2. @Luis – that redirect to index issue could be related to URL key’s try logging in and out again, and check you have them enabled. Enable logging and check the output of the log too – if you get anything, post it here.

  3. Running into a road block: Error :

    Using: Google Apps – myemail@mydomain.com
    Extension Option: SMTP
    Authentication: Login
    Username myemail@mydomain.com
    Password: ******
    Host: smtp.gmail.com
    Port: (587) (465) and (26) I have tried
    SSL: SSL TLS

    My setup went just fine when i connected it to Outlook Express (POP)
    Using settings:

    Port: 587
    SSL TLS

    If outlook excepted port 587 then i dont think my host is blocking?

    this is the ERROR:

    Testing outbound connectivity to Server:
    Using SMTP configuration options
    Failed to connect to SMTP server. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port: 587

    PLEASE HELPA!

  4. 2010-04-19T16:01:36+00:00 DEBUG (7): Running SMTP Pro Self Test
    2010-04-19T16:01:36+00:00 DEBUG (7): Development mode: disabled
    2010-04-19T16:01:36+00:00 DEBUG (7): Raw connection test….
    2010-04-19T16:01:36+00:00 DEBUG (7): Complete
    2010-04-19T16:01:37+00:00 DEBUG (7): Actual email sending test….
    2010-04-19T16:01:37+00:00 DEBUG (7): Preparing the SMTP Email transport, details are: \n username=info@mydomain.com
    password=MASKED
    host=smtpout.secureserver.net
    port=3535
    ssl=none
    auth=login

    2010-04-19T16:01:37+00:00 DEBUG (7): Returning transport
    2010-04-19T16:01:37+00:00 DEBUG (7): Test email was not sent successfully: Could not read from smtpout.secureserver.net
    2010-04-19T16:01:37+00:00 DEBUG (7): Complete

  5. Are you running magento on the same system as outlook? If not then it still could be firewall issue on the system running magento – try a telnet test? e.g: telnet $host $port – let me know how it goes.

  6. That looks like a networking issue to me – have you tried running magento locally and testing the same settings? Perhaps test with a gmail address too, to try and isolate the problem area.

  7. Hi Ashley,

    First of all, thanks to you for your SMTP tool.

    I have a problem and I don’t passed the test.

    I have this configuration:

    —SMTP Pro Email General Settings
    Choose extension option: SMPT
    Use Store Email Addresses for Reply-to: no
    Development Mode options: development mode disabled

    –SMTP Pro Email Google Apps/Gmail Settings
    Email address: “jlmaldo84@gmail.com
    Password: “xxxxx”

    –SMTP Pro Email SMTP Settings
    Authentication: Login
    Username: “jlmaldo84@gmail.com”
    Password: “xxxxx”
    Host: smtp.gmail.com
    Port: 465
    SSL security: SSL

    The result of the test is:
    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using SMTP configuration options
    Connection to Host SMTP server successful.
    Sending test email to your contact form address jlmaldo84@gmail.com:
    Unable to send test email. Exception message was: Could not read from smtp.gmail.com…
    Please check and double check your username and password.

    If I change the following parameters to:
    Port: 465
    SSL security: NO SSL

    The result of the test is:
    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using SMTP configuration options
    Connection to Host SMTP server successful.
    Sending test email to your contact form address jlmaldo84@gmail.com:
    Unable to send test email. Exception message was: smtp.gmail.com has timed out…
    Please check and double check your username and password

    Do you have any idea?

    Thank you very much

    Best regards

  8. Other step:

    When I try to telnet to gmail with the next command in the prompt system:

    telnet smtp.gmail.com 25, I have the conection but only a few seconds.

    Could it be a network problem? I am at home with the firewall off.

  9. @Julio – Good work trouble shooting so far. Two suggestions – if you’re using gmail, why not use the gmail/google apps settings instead of SMTP? And try telnet with port 465 and 587 too.

  10. Hi Ashley,

    I have tried telnet with ports 465 and 587 and the same is happening. I connect but only for a few seconds.

    I have tried with gmail/google apps and the same problem: Could not read from smtp.gmail.com…

    I am using magento 1.4.0.1 with SSL in backend. I am using a USB stick to get Internet so I have any router to manipulate and see if my ports are closed.

    I am going to try in another computer with a better conection.

    Anyway, any ideas would be welcome.

    Best regards,

    Julio

  11. Strange – I wonder if it is a php security setting or something. I’m not sure quite what to suggest I’m afraid. Maybe try installing a diff php app e.g wordpress (5mins) and setting up the smtp extension for that to test if it is Magento specific or php specific?

  12. Hi Ashley,

    I have just tried with telnet smtp.gmail.com 25 and I am be able to communicate with the smtp protocol so I have gone to use your tool and now it is working. I have tried with 465 port and it is working as well.I don’t know what has happened but now it is working.

    Thank you very much

    Julio

  13. So, I installed, and it looks great. I’m able to send a test email to my account, but the self test says it can’t get to the server… very odd.

    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Failed to connect to Host SMTP server. Reason: ()
    This extension requires an outbound SMTP connection on your specified port.
    Sending test email to your contact form address jack@foreverett.com:
    Test email was sent successfully.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    I’m trying to get around my host’s inability to be friendly with the email, like the contact us or password resets, etc.

    BTW – I have it configured for my gmail account – smtp.gmail.com, SSL. I would like to configure it back to the smtp server i have on my hosting package.

    Good work!

  14. Hello,

    I trie to use but gote this error:

    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using SMTP configuration options
    Failed to connect to SMTP server. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port: 587
    Sending test email to your contact form address dbc_lojavirtual@oxigenio.com:
    Unable to send test email. Exception message was: Connection timed out…
    Please check and double check your username and password.

    any idea?

    I´m using a fresh install of Magento 1.4.0.1

    Kind Regards from Brazil,

    Darley Cassimiro

  15. @Almost There – for testing with gmail use the google apps/gmail settings instead of smtp – then at least you can rule out ports/ssl issues with the config. I haven’t seen an error like the one you’re getting before, perhaps enable logging and also post your log output during self test and various other actions (e.g. contact us)?

    @Julio – that’s great, glad to hear it

    @Darley – I’m leaning to connectivity issues, but a lot of people are getting ‘connection timed out’ errors lately – perhaps it is more of an issue. Can you send log output and also try telnet to the host/port on the command line please?

  16. I switched over to the smtp server for my host, and the self test worked – now if i could only get the email i sent. (I think it’s an issue with the host)

    So final question – how do i get the contact form to use your mailer? It still says Unable to submit your request. Please, try again later when i submit 🙂

    Thanks again!

  17. Does any emailing work, i.e new order, new account etc?

  18. No. WHich is why i was looking @ the smtp server itself. i know this is outside the scope of your blog here, but i would appreciate any ideas.

  19. I’m having the same exact error as Darley. My ports are opened, confirmed by my host at least. I was able to get it to work with my host’s smtp, but not with smtp.gmail.com.

  20. I’ll be in touch about this Joe, if I can get onto a server exhibiting the error, I can try to figure out what’s going on, and determine if it is a common problem affecting gmail/smtp email communication on Magento.

  21. So it looks like I was running the wrong version of your app – i got it off of magneto connect. i removed it and then installed the new version from yoru website, but man when i enable it the admin part is broken.

    hmmm… well now it’s a new set of problems 🙂

  22. Oh yeah, and I refreshed the cache…

    I even flushed and then refreshed…. should i flush the storage cache as well?

  23. What do you mean by broken? What’s not working, do you get an error?

  24. Well the truth is, I’m helping out a work buddy with his problem – i wonder if he botched his install 🙂

    But, I e-mailed you some of the error reports; I hope they’re useful to you.

  25. Hello,

    I had a hard time to make this work and the problem was that booth port, 587 and 465 was close at my server (VPS at Hostgator).

    Now is working like a charme. Thank you.

    I sugest that add in the test inside of script, a option to check if the ports are open or not. This will save time for many people.

    Kind Regards from Brazil,

    Darley Cassimiro
    http://www.oxigenio.com

  26. So it looks like I was running the wrong version of your app – i got it off of magneto connect. i removed it and then installed the new version from yoru website, but man when i enable it the admin part is broken.

    hmmm… well now it’s a new set of problems 🙂

  27. @Darley and Amy – sorry for the delay with your comments, seems Akismet was being a bit overzealous, hopefully no one else has been marked as spam incorrectly!

    @Darley – the self test checks for outbound connectivity with a actual network connection like so: $fp = fsockopen($host, $port, $errno, $errstr, 15); so if the ports are closed then this will fail and the self test will report accordingly. At least that is what I understood was happening, is there a different way to test, if so let me know and I will add it – the more testing the merrier.

    @Amy – Let me know more about your problems with the extension and I can try to help.

  28. Hi
    I have installed this extension and “Run seld test” is working fine but when i used Magento contact form i got this error
    “Unable to submit your request. Please, try again later”

    and here is my log file.

    2010-05-09T21:32:44+00:00 DEBUG (7): SMTPPro is enabled, sending email in Aschroder_SMTPPro_Model_Email_Template

    any idea ?

  29. First, great extension! I have tested using the built in self test as well as a new customer creation and I am getting both emails! The issue I am having is when I submit a contact form.

    What I have is a contact form put on a static CMS page. I am also using reCAPTCHA to prevent spam. I have this code in the page layout –> Layout Update XML section:

    The form appears on the page and appears to be ‘working’. I fill in the fields and type the captcha and hit “Submit” button. The page refreshes and I now see the empty contact form. The problem is, I never get the contact email.

    I looked at the code and in the contacts.phtml file I see this code which I think is the submit button:

    <button type="submit" title="__(‘Submit’) ?>” class=”button”>__(‘Submit’) ?>

    My question is, you comment that if they aren’t using the Magento default send the extension won’t work. Can you tell from the above code what I have going on?

    Thanks,
    Brad

  30. It didn’t display my code. Perhaps the form is interpreting HTML. Here it is again:

    I have this code in the page layout –> Layout Update XML section:

    I looked at the code and in the contacts.phtml file I see this code which I think is the submit button:
    “<button type="submit" title="__(‘Submit’) ?>” class=”button”>__(‘Submit’) ?>”

  31. Man, that really isn’t working. Please let me know a good way to get you the sample code…

  32. I just installed this and it seems to be working perfectly locally!

  33. Trying to make it work and getting this message when running the test:
    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using Google Apps/Gmail configuration options
    Failed to connect to SMTP server. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port: 587
    Sending test email to your contact form address d.lambrianov@gmail.com:
    Unable to send test email. Exception message was: Connection timed out…
    Please check and double check your username and password.
    Contact Form test email did not use SMTPPro to send.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    The setup is this:
    Choose extension option: Google Apps/Gmail
    Use Store Email Addresses for Reply-to: No
    Development Mode options: Development Mode Disabled

    Gmail setup:
    Email address: d.lambrianov@gmail.com
    PW: xxxxxx

  34. I’m using the SMTPPro on my Magento 1.6.0 installation.
    It really works great!
    It solves the Magento SMTP bug as sending Mail as apchache@ …

    But although it is working great, SMTPpro still reports the DEBUG(7) logs in the Magento Systemlog.
    Can I turn this logging off?? it’s really messing up my log with a lot of unnecessary lines of log entries that say, “No problems, it works great”. I only want to see real errors in my system log…

    Thanx in Advance…

  35. Hi, logging can be turned off globally in the Magento developer settings. you cannot turn it off just for SMTP Pro, though in production you shouldn’t enable logging unless you need to.

    If you really want to stop the logging in SMTP, you could just find and comment the Mage::log() lines.

  36. Hi Ashley,

    First of all, thanks to you for your SMTP tool.
    I have a problem above all and I don’t passed the test.
    I have this configuration:

    —-SMTP Pro Email General Settings

    Choose extension option :Google Apps/Gmail
    Development Mode options :Development Mode Disabled
    Log all messages :YES

    —-SMTP Pro Email Google Apps/Gmail Settings
    Email Address:info@adorepearls.com
    Password:*******

    —-SMTP Pro Email SMTP Settings

    Authentication : login
    Username : info@adorepearls.com
    Password :******
    Host : smtp.gmail.com
    Port : 465
    SSL Security : SSL TLS

    The result of the test is:
    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using Google Apps/Gmail configuration options
    Failed to connect to SMTP server. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port: 587
    Sending test email to your contact form address help@AdorePearls.com:
    Unable to send test email. Exception message was: Connection timed out…
    Please check and double check your username and password.
    Contact Form test email did not use SMTPPro to send.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    If I change the following parameters to:
    Port: 465
    SSL security: NO SSL

    The result of the test is:
    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using Google Apps/Gmail configuration options
    Failed to connect to SMTP server. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port: 587
    Sending test email to your contact form address help@AdorePearls.com:
    Unable to send test email. Exception message was: Connection timed out…
    Please check and double check your username and password.
    Contact Form test email did not use SMTPPro to send.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    If I change the following parameters to:
    Port: 465
    SSL security: SSL TSL
    The result of the test is:

    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using SMTP configuration options
    Failed to connect to SMTP server. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port: 587
    Sending test email to your contact form address help@AdorePearls.com:
    Unable to send test email. Exception message was: Connection timed out…
    Please check and double check your username and password.
    Contact Form test email did not use SMTPPro to send.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    If I change the following parameters to:
    —-SMTP Pro Email General Settings
    Choose extension option :Google Apps/Gmail
    Development Mode options :Development Mode Disabled
    Log all messages :YES
    The result of the test is:

    ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using SMTP configuration options
    Failed to connect to SMTP server. Reason: Connection timed out(110)
    This extension requires an outbound SMTP connection on port: 465
    Sending test email to your contact form address help@AdorePearls.com:
    Unable to send test email. Exception message was: Connection timed out…
    Please check and double check your username and password.
    Contact Form test email did not use SMTPPro to send.
    Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.

    —-Other step:
    When I try to telnet to gmail with the next command in the prompt system:
    telnet smtp.gmail.com 25, I have the conection and get some words below:
    220 mx.google.com ESMTP jz4sm5452449pbc.17

    telnet smtp.gmail.com 465, I have the conection and get nothing;

    telnet smtp.gmail.com 587, I can not connect to it:

    C:\Documents and Settings\jacklee.li>telnet smtp.gmail.com 587
    Connecting to smtp.gmail.com … can not open connection to the host, on port 587: Connect failed

    and there is nothing in the email log.

    Do you have any idea?

    Thank you very much
    Best regards

  37. hi,
    Ashley.i have solved my problem by send mail through host.i use the google MX and the hostmonster MX.and thank you very much!

  38. I installed the extension and it works great for built-in email functions!

    I have a custom built module that sends mail… which of course isn’t working. is there a way for me to hook into your extension’s email send method? Please advise,

    Thank you!

    Erin

Comments are closed.