New SMTP Pro Magento Email extension released

June 4, 2010

I’ve had a chance to make a couple of improvements to my SMTP Pro email extension for Magento. Both changes are not exactly life altering, one adds extra error detection to the self-test, and the other fixes a header problem with the self-test (reported by Phil). More details follow about the changes, if you want to get the extension, download SMTP Pro on Magento Connect. (Updated: finally on Magento Connect!)

I now send a real live contact form message as part of the testing – and ensure that when the email sends, my extension code is actually being called. I’ve had a lot of people reporting problems with emails not sending lately, only to find it’s because some other extension is interfering with my email sending. This tweak to the self test will help identify those issues.

This is implemented as a static variable on the self test controller, that is set before sending the test email and then altered by the email observer (if it is called as expected):

// Now we test that the actual core overrides are occuring as expected.
// We trigger the password forgot email, as though a user had done so.
 
self::$CONTACTFORM_SENT = false;
$this->_sendTestContactFormEmail();
 
// If everything worked as expected, the observer will have set this value to true.
if (self::$CONTACTFORM_SENT) {
	$msg = $msg . "<br/> Contact Form test email used SMTPPro to send correctly.";
} else {
	$success = false;
	$msg = $msg . "<br/> Contact Form test email did not use SMTPPro to send.";
}

and the code in the observer that alters this variable:

// For the self test, if we're sending the contact form notify the self test class
if($event->getTemplate() == "contacts_email_email_template") {
        include_once "app/code/community/Aschroder/SMTPPro/controllers/IndexController.php";
        Aschroder_SMTPPro_IndexController::$CONTACTFORM_SENT = true;
}

The other change was trivial, adding a ->setFrom() call when sending the test email. Thanks to Phil for pointing that out.

Lastly, Eric requested a useful feature which I will add, but I haven’t had time to put that in to this release, next time!

Let me know any feedback you have on the changes, or if you’re having trouble sending emails in Magento – feedback welcome.

Ashley

Posts

Hi! I'm Ashley Schroder, a Software Engineer from New Zealand - this is a collection of notes on my experiences with Ecommerce Web Development, particularly Magento Development.

Are Your Customers Getting The Magento Emails You Send?

MageSend Magento Email sending with Amazon SES

I have made a premium Magento Extension called MageSend. MageSend makes it simple and easy to send using Amazon's highly reliable SES email service.

The extension is $99, and comes with a complete money back guarantee, please check it out, I am confident it will resolve any email sending problems with your Magento store.

77 responses to New SMTP Pro Magento Email extension released

  1. Hello,
    any patch for Magento 1.4.1.1?
    For my stores with this version doesn’t work (same problem like @Andrew)

    Thanks!

  2. @Raska – check for extension clashes? Try disabling all other extensions except mine and then try – you disable them in app/etc/modules.

  3. Jeff, you made my day! Blog readers helping other readers, a beautiful thing.

  4. @Ashley – No prob. Whenever I see a question posted somewhere that I know the answer to, I always make it a point to answer. So many people have helped me over the years, so it doesn’t hurt to give back. 😉

  5. Hi Ashley,

    Thanks for your work on this ext.

    It seems that it installed OK as the test gives me a positive result. My template mail system is not working and I am yet to get to the bottom of that, I don’t think it is related to your ext.

    I am however, getting the following error page when the Self Test is run:

    “Parse error: syntax error, unexpected T_CATCH in /home/bowtie/public_html/magento/app/code/core/Mage/Contacts/controllers/IndexController.php on line 119”

    Would you know why this is occuring?

    Cheers.

  6. @Jeff:
    Thanx buddy, I finally installed it manually, and it worked!
    The only thing is that I´m working locally for the moment, and after trying all kind of configuration still can´t make it work, no mail comes out of my PC… I´m using WAMP2, unfortunately it has no SMTP engine: Found few solutions on-line. All of them a bit doughy and complicated to set up. It´s kind of tricky to get all settings together to get ur PC to do the job… Mission impossible, at least for my knowledge.

    If someone wants to accept the challenge, I´ll really apperciate a bit of help and guidance here…

    Thanx again mate!! well… and to you all, brilliant site for Magento help

    Tino

  7. Great plugin, Ashley. Everything seemed to be working fine until I upgraded to 1.4.2. Now, it seems that no emails are being sent out. I ran a test again, and got successful results.

    “ASchroder.com SMTP Pro Self-test results
    Testing outbound connectivity to Server:
    Using Google Apps/Gmail configuration options
    Connection to Host SMTP server successful.
    Sending test email to your contact form address napoleonsmacarons@gmail.com, razmigootioun@gmail.com:
    Test email was sent successfully.
    Contact Form test email used SMTPPro to send correctly.”

    Any ideas what might be wrong?

    Thanks!
    Heather

  8. Did you manage to find a solution to your problem? The test output looked fine, so it could be a server environment issue or an extension clash?

    One way to check, try enabling logging on your magento install, send a few test emails and also do a few things that normally send an email, such as forgot password, new account, subscribe to newsletter etc.

    Then see what gets logged.

  9. Thanks for getting back to me, Ashley. I am not having any luck with the messaging system since upgrading. I sent you a direct email with specific error messages – hoping that you might be able to assist me in figuring this out… I am very new to Magento.

    Thanks,
    Heather

  10. Hello,
    thank you for your extension.
    I have install it in my magento 1.5.0.1,test OK, but order email only send to admin,NOT to my customer,could you please help me?
    thank you

  11. Hi
    I am unable to find smtp configuration form in admin side where i could enter smtp details.

  12. Hi Ashley,

    I’ve installed the extension in a 1.4.2.0 environment. Nothing special about the installation itself. The Self test reports all is ok.

    Sending a message through the contact form on the front end works.

    However, order emails are not send out. When I manually send an order-confirmation email in the backend I get an error message: “Failed to send the order email.”

    Furthermore, using the “lost password” form on the frontend gives the error message: “Cannot set standard header from addHeader()”

    System log messages do not reveal anything, it just states: “SMTPPro is enabled, sending email in Aschroder_SMTPPro_Model_Email_Template”

    Any idea?
    Thanks.

  13. @Hendrikus Are you using the latest version? That issue was fixed a couple of months ago.

  14. Check out the latest version of my extension (1.4.2) for Magento 1.5 support. It’s available on Magento Connect, and on this blog.

  15. Hi Ashley,

    Version installed was 1.3.4 so I uninstalled it and installed 1.4.2
    Tested it and it’s working OK!

    I should have checked the version info before posting, sorry for that…

    Thanks!
    Excellent extension!

  16. I have used connect to install the extension but see no where on any of the menus a play or link to configure the extension. I am using Magento 1.5 and about to jump off the roof. I can;t get magento to send emails to anyone outside the website domain. I am praying that your extension can help.

  17. Hi, When trying to filter the archived emails in the backend:

    http://screencast.com/t/lDZUfZfR

    See the screencast for more info.

    This is NOT mission critical but it would be nice to have some kind of validation after 10000 emails.

    I love the extension

    Michael

  18. I see a few people having the same issue, but no answers, so I’ll chime in as well: install goes fine, but no section in the config / admin.

    Anyone know why?

    (Magento 1.3)

  19. If you do not see the configuration menus in System->Configuration->System then try refreshing your cache.

  20. Hi Ashley,

    I’ve installed 1.4.3 on a Magento 1.5.0.1 version.
    Although the extension is working ok, I cannot access the email log: I get an 404 error page. The url looks like this: https://www.domain.nl/index.php/admin/smtppro/log/index/key/d5cfab326f7c998a31dacf313a91d37c/

    Any idea?

  21. I have installed the extension, it is great!
    but I can not setup google app, it does not work,only can use SMTP, I do not why.
    P.S. thank you for your extension.

  22. Hi I’m having a few problems with the module. Although the test email sends fine. Magento does not seem to be using the module.

    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 chris.p.heron@googlemail.com:
    Test email was sent successfully.
    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.

    I have confirmed this error message by trying to manually submit the contact form and I get “Unable to submit your request. Please, try again later”

    Am I missing settings?

  23. Hello Ashley,

    I thought that I got working the extension because it sends the test email correctly, but all the other emails are not being sent (like registration one).
    I’ve checked all that came to my mind and ran out of ideas.
    Do you know what might be wrong?

    Thanks.
    Rodrigo.

  24. Hi Ashley,

    We are experiencing an issue with confirmation emails being classed as spam by a number of email clients like… Hotmail.

    Some of the emails are found in the “Spam” folders but frustratingly, many are not and are not ever received by the customer.

    A number of forums are suggesting this extension as a possible fix but we have had this installed for a long time and have been very, very happy with its functionality.

    Sadly, this situation has us stumped… Would you have any ideas on a possible resolve?

    Thanks in advance

  25. Great extension, Ashley, thanks! Have been using it for about a year now without any issues.

    For anyone on a VPS server suddenly getting “535 Incorrect authentication data” error, it is caused by the automatic WHM upgrade which changed one of the server email settings.

    So, if you are on a VPS server using SMTP Pro and suddenly all outgoing emails stop working, here is one possible issue to check for:

    1) Login to WHM
    2) Under Server Configuration, select Tweak Settings
    3) Click on the Mail tab
    4) Scroll down to “Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)” and make sure it’s set to “OFF”
    5) Scroll to the bottom of the page and click Save

    Hope this helps someone with similar setup!
    Peter

  26. Hi I’m having a few problems with the module. Although the test email sends fine. Magento does not seem to be using the module.
    I thought that I got working the extension because it sends the test email correctly, but all the other emails are not being sent (like registration one).

    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 someemail@gmail.com:
    Test email was sent successfully.
    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.

    Am I missing settings?

  27. I’m new on Magento. I try to install SMTP Pro extension, when I click “Install” button, I’ve got an extension key but I don’t know where to use this key. Please advice.