In Gmail's settings, under "Accounts and Import", I added a new email address under the setting "Send mail as". This email address using my own domain, foobar@example.com let's say. I've configured Gmail to send using Fastmail's SMTP servers.

This domain has been set up on Fastmail. The MX records have been set, and I've added the alias, instructing Fastmail to forward all email to my @gmail.com address.

Receiving mail at foobar@example.com does work as expected, the email shows up in my Gmail inbox. Sending from Gmail's web interface as foobar@example.com also works. However, the recipient gets the email as it came from my @fastmail.com email address. How do I fix that?