Question: I have a Google apps account attached to my web server's domain. I work like to be able to test my email application using my personal email address.

Web server is at thinktankdesign.ca
email is going to robert@thinktankdesign.ca

mail.thinktankdesign.ca is pointing to google.

How can I stop the server from handling the message internally. I don't want the message send to /var/mail/\*my\_username\*

I'm running Ubuntu 10.04

Cheers!

Answer: 
If I'm reading right, it sounds like PHP's using the local mail delivery agent (sendmail?) to hand off mails, which then in turns sends things to Google.

You'd have to use something [PHPMailer](http://phpmail.worxware.com) or [SwiftMailer](http://swiftmailer.org), which have simple methods of directly setting which SMTP server to hand the mail off to. PHP's internal `mail()` function is simplistic and does a local handoff only.

So instead of

```
your code -> local mail agent -> google

```

it'd go

```
your code -> google

```

and the local mail spool should never get touched.
You must change you mail DNS MX record.
Just look at this page [Configure email delivery](http://www.google.com/support/a/bin/answer.py?hl=en&answer=33352)