New here? Then you may want to subscribe to my rss feed. :)

[Updated] The problem with using Google Applications SMTP to send email

May 18th, 2007 | Posted in Google, Hints and Tips, Techy Talk | 5 Comments

Update - I was asked about which PHP scripts I use to send email via Google’s SMTP server. The most popular (or well known) one is PHPMailer, problem is that it doesn’t support TLS authentication. SwiftMailer does all that PHPMailer does with the added benefit of sending emails through Google.

You may already know that you can send emails from web forms using Google Applications SMTP server, which is really handy if you have your own VPS as a way of preserving resources such as memory and disk space when installing your own mail server and spam filtering software.

A minor problem with this is when sending emails from web forms using them as the SMTP server.

When emails pass through their SMTP server, the from and reply-to addresses are rewritten to the default one for that account. So if the default account is someone@somewhere.com and the generated email from your php script sets the from address to donotreply@mywebsite.com. By the time it appears in your Gmail inbox, the from address would have been replaced with someone@somewhere.com. This becomes a problem when downloading emails, Google POP server does not allow the download of emails where the from address is the same as the default account address. Bugger! (They do not make this very clear, tut tut)

The only way round this is to change the default email address for the account. But if you have several sites with several from addresses then this is not a viable solution.

A way to download emails via POP is to prefix your username with “recent:” like so:

recent:someone@somewhere.com

This works OK for me, but some people have had this download all emails, including junk. So test before committing to this.

5 Responses to “[Updated] The problem with using Google Applications SMTP to send email”

  • Gravatar
    Skiguru Location: Great Britain (UK) //

    Hi,

    Have been searching for clues about switching to google apps for mail and the likelihood that all my mail now gets blocked as spam because of it? Is there a possible correlation? When I was using standard pop3 with Outlook, I had the sensation that everyone was getting my mail.. They used to reply to me! Since switching to Google, I get the feeling that all my mail goes off into hyperspace and never ends up at it’s destination… How depressing! Anyway, I liked the post about the 4th birthday transforming into a mental conundrum… I have the same problem with mini-transormers from Kinder eggs… Anyway Any thoughts would be groovy
    Best wishes
    skiguru

  • Gravatar
    Fiaz Location: Great Britain (UK) //

    An obvious test would be to send a bunch of emails to different recipients and ask them to reply. Both from your google apps address and another non google apps address. Then check your spam for responses. Obviously, this needs to be done to people who wouldn’t mind replying.

    I too get problems with the spam filter. Recently found some enquiries for work sat waiting there.

    I have asked this question (this morning) on google groups, i suspect that i won’t get a response. Google’s groups generally, for me anyway, have a poor response rate.

    Their documentation says to add the sender as a contact to ensure it does not get flagged as spam, but if the enquiries come from a web form, you won’t know who they are. I am guessing that there is a way using labels/filtering, havent worked it out yet though.

  • Gravatar
    Skiguru Location: Great Britain (UK) //

    Hi Fiaz,

    Thanks for that - By the way, your email to me was in my spam folder…

  • Gravatar
    Stavros Location: Greece //

    That is true. I have done some tests and it turns out that mail sent from Gmail’s SMTP server is flagged as spam.

  • Gravatar
    Fiaz Location: Great Britain (UK) //

    I have put a solution here to get round the problem of google placing email in spam.

    Hope it helps.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>