I have a Google Apps account with 1 primary domain and a secondary alias domain (let's say example.co.uk and example.com). When I send emails from the alias domain, the receiving person sees the sender as "email@example.com On Behalf Of firstname.lastname@example.org", which is a bit messy. How do I get rid of this?
To do this, you need to set up Gmail to send emails via an "external" mail server. However, since the alias domain is already registered with Google, you can in fact set this "external" server to their servers and have it work just fine!
- Gmail -> Settings -> Accounts -> Edit Info (on alias account) -> Next Step -> Send through example.com SMTP servers (recommended for professional domains)...
- SMTP Sever: smtp.gmail.com, Port 465
- Username: email@example.com (Note: not the alias domain login, but your main Gmail login)
- Password: (Password for the above account)
- Select Always use a secure connections (SSL) when sending mail.
If you don't have this other domain added as an alias and are just sending from an additional email address you'll have to send via the email servers of this other domain.
(Yes, I know I answered my own question, but it took me an age to figure this out, so I wanted to share it!)
You can use gmail's send-through feature. Under settings -> accounts and import, edit the email address in question, and when prompted, choose to "send email through example.com SMTP servers". After configuring the SMTP server settings, you should be good to go.
Here's my writeup on why the accepted answer both works and doesn't:
Basically, you need to set both the SPF and DKIM fields for "via" to go away. There's a bug that removes "via" if you have neither set, but that's just a bug, and you really should set both for deliverability anyway. That should allow you to properly remove the "on behalf of" display in Gmail.