Getting the custom from_address for a domain was foxing me the last couple of days so hopefully this will help someone in the same position.
Problem
After setting the custom domain and publishing my app, the custom from_address setting was not propagating when I sent test emails, even after committing / publishing changes.
So this email
@anvil.server.callable
def send_anvil_email():
anvil.email.send(
from_name = "My App Support",
from_address = "mail@myCustomDomain.app", # <-- Custom address
etc . . . .
Still arrived like this
This made me sad and many hours were spent trying to fix this ![]()
Issue
The issue was that I was sending from the Anvil workspace in the editing environment not from the published app itself. So the environment I was using was the issue, not the app setting.
Once I logged in to the published app and sent an email or sent via a server background task, the custom domain showed up just fine.
~ ~ ~ ~
Hopefully this saves someone in a similar situation some angst and wasted time in the future.
