I've got google apps setup, with the mx records working. Any emails to me@mydomain.com now go to my google apps, great.

Now i want to use google apps for sending automated emails (ie lost password, registration)

How do i set it up so that php's mail() using googleapps?

is this correct?

also, is there anyway for test (sending myself multiple emails) without google thinking im spamming?


There's a couple of limitations to Google's Standard (free) Edition (I'm assuming that's what you're using) that you should be aware of:

You can only send to 500 external recipients daily: http://www.google.com/support/a/bin/answer.py?hl=en&answer=166862

I can't verify this, but I've read (somewhere) that the number of invalid/undeliverable addresses you attempt to send to can trigger a suspension, so I'd recommend verifying the email accounts at sign-up if you're not already doing so.

Finally make sure you have SPF records setup for your domain.

Also PHPMailer (it's 3rd-party) is fine, but you may prefer SwiftMailer instead; I've been using it exclusively now as I find it a bit cleaner/OOP friendly: http://swiftmailer.org/

| improve this answer | |
  • thanks for the tips, what are SPF records? – haroldo Mar 18 '10 at 14:28
  • Sender Policy Framework (SPF) records are increasingly being adopted to evaluate (partially or entirely) whether or not a host is permitted to send mail for a particular domain. In your case, your SPF records for yourdomain.com would include a line that includes google's mail servers as being allowed to send mail. If you hit up your Google Apps help section, I believe there's an FAQ entry that tells you what to put in your SPF records. – gravyface Mar 18 '10 at 20:59

It is perfectly possible to send out automated messages using phpmailer, but be aware that Google's tolerance may be lower than the 500-recipient limit mentioned by Gravyface. I have been using a "noreply" account to send out opt-in notifications from a web application and today I discovered that this account was suspended for abuse.

I'm pretty sure I wasn't sending out spam or hitting the daily 500 (or even 100) message/recipient limits, so be aware that Google Apps can be employing additional checks for detecting "abusive" accounts.

Addendum: I contacted the support and they re-enabled my account within the time between my original answer and this edit (w00t, Google!). Apparently, their abuse detection mechanisms are having the twitchy-trigger-fingers, but they are aware of the issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy