This blog post is about the SMTP Pro extension. It is my attempt at full explanations to some very good questions/feedback from Chris Last in his comment on an earlier post. I decided that I should give thorough explanations to the questions and they probably belong in a blog post rather than a reply comment. Hopefully it’ll form a mini user-guide, I’ll try to update it as such over time.
Update July 2013: I have since released a premium extension for sending email using Amazon SES called MageSend, if you’re having toruble sending email with Magento, please check it out, it was created to solve many common Magento email issues.
There are too many sections in Config->Advanced->System for me to make complete sense of:
Mail Sending Settings – do these have any effect?
Disable Email Communications No
Port (25) 25
Set Return-Path no
1) The Mail Sending Settings are the built in Magento ones, they don’t work very well for custom SMTP servers and you can safely ignore them. One thing to note though. I do adhere to their disable configuration in my extension. So if you disable all emails using the core config here, all emails do stop even if sending via SMTP Pro.
SMTP Pro Email General Settings – what does this section do that the similarly-named but different section below doesn’t do?
Choose extension option SMTP
Use Store Email Addresses for Reply-to No
Development Mode options Disabled
Log all messages Yes
SMTP Pro Email Google Apps/Gmail Settings
SMTP Pro Email SMTP Settings – does this mean ‘settings if you tske the SMTP option in SMTP Pro Email General Settings’ (above)?
Password mystandaloneaccount password
Port (intentionally blank)
SSL Security SSL
2) Let me try to explain how each of the settings sections work.
The General Settings section is where you configure settings that apply to all send types (SMTP, Google, Amazon SES). For example enable or disable email logging. It is also (most importantly) where you choose which of the various send types you will use. In your example you chose ‘SMTP’.
The other sections are for specifying the connection details for that particular method. So for example the Google Apps/Gmail Settings are for your Gmail username and password for sending via Google. Or the SMTP Settings are for your custom SMTP server username, password and server address/port etc.
In your particular example you had filled out settings for sending via Google servers AND via a custom SMTP server, which incidentally was Google’s server.
I can see how this could be confusing. Basically the Google send option is there to make it really easy to send via Google – behind the scenes my extension will set the server, port, SSL etc so that all you need to input is the right username and password – it does the rest for you, so you don’t have to hunt for the right settings.
The SMTP option is for custom SMTP servers where you need to specify the server, port, SSL settings etc. Now, it’s true that if you use the right settings for gmail, you can send via Google’s servers using this SMTP settings section – but it’s more work than is required. In your case you input some but not all of the right settings here, so the test is failing (or should!).
The option you should use is the Google/Gmail setting, that way you only need to input your username and password (which you actually already have, but have not chosen to use int he General settings).
This is what I get:
ASchroder.com SMTP Pro Self-test results
Testing outbound connectivity to Server:
Using SMTP configuration options
Failed to connect to SMTP server. Reason: ()
This extension requires an outbound SMTP connection on port:
Sending test email to your contact form address firstname.lastname@example.org:
Test email was sent successfully.
Contact Form test email used SMTPPro to send correctly.
Testing failed, please review the reported problems and if you need further help visit ASchroder.com to contact me.
When I change Choose extension option to Google Apps/Gmail it hangs with a ‘no data received’ browser error and I have to back-arrow to return to the magento config page.
Also, I don’t understand what ‘Test email was sent successfully’ means as, if the line ‘Failed to connect to SMTP server’ is true, by what magic did the SMTP commands get issued?
I get the ‘If you are seeing this email then your SMTP Pro settings are correct!’ email though, and I simultaneously get the ‘Contact Form’ email successfully too.
3) These are definitely not standard results. If you receive the test email with the settings you describe, then that could actually be a bug. The settings you describe probably shouldn’t work so the fact they do is worrying. Can you please email me a screenshot of the settings and the result so I can confirm?
Regarding the failure to save the ‘Google Apps/Gmail’ setting, I’m not sure what that could be – my extension doesn’t trigger any behavior on save so it could point to underlying Magento problems? I’d have to see it happen to know for sure. This is definitely the setting you should be using given your setup though.
What I want is to use my Google Apps Domain and, as I couldn’t get it to work, I fell back to using a standalone gmail account. Now I’d like to get the standalone account to work without the errors, then go on to get the Google Apps domain to work.
4) You can use your Google Apps email account in the exact same way that you use the standalone Gmail one. Just input the email address and password in the Google section and you’re all set.
One minor thing – could any of the ‘Run Self Test’ screen messages that have the word ‘success’ in them be in a green hue rather than a red one?
5) People always ask software engineers ‘Can it do this thing X?‘ – to which the answer is almost always Yes. Sadly, there is never enough time to do all the possible X’s and we must choose only some of them. I shall add that request to the list though, as it is a good one!
A Question from Koen (and plenty of other people):
My test reports:
Test email was sent successfully.
Contact Form test email did not use SMTPPro to send.
6) This is mostly caused by extension clashes. Part of the self test checks that the code sending the emails is my code, and if it is not – this is the error message you see.
My usual suggestion is to install on of the extension conflict checking extensions (e.g this one). If you do not see any conflicts, you can also check the headers of the email being sent – to make sure it is being sent by the gmail/smtp server you configured.
If there are no conflicts and the server you expect is doing the sending, then this might be a false negative and you should let me know.
Thanks again for all your freely given hard work – hope this helps and grateful for any response.
You’re most welcome, I appreciate the feedback. I hope this post clears up some confusion, and I hope that other people with similar questions will now find this blog post! Thanks again for the input Chris, please feel free to ask any other questions to clarify.