Configure a custom email account
Emails sent from the Send Email action node use the built-in Appfarm email account by default. The sender domain is an Appfarm domain (appfarm-mail.com), and the Display Name defaults to your Solution name.
If you would prefer these emails to be sent from your own domain, you can connect your own email provider — Mailgun, Amazon SES, SendGrid or Microsoft 365. This page explains how.
Authentication emails are handled separately. Login links, one-time PIN codes, password-reset links and welcome/confirmation emails are not sent through the provider you configure here. See Authentication emails below before configuring a provider for branding reasons.
Mailgun
Here's a short step-by-step guide for setting up your custom email account using Mailgun as email provider.
On mailgun.com and your domain
Go to https://mailgun.com, set up an account (if you do this on behalf of someone else, they should set up the Mailgun account)
Click “Sending”
Click “Add new domain”. Here you name the domain you want to use. For instance mg.mydomain.com (Mailgun recommends using “mg.” before the domain, read why on mailgun.com). You have to choose a region, this may have something to do with where the mail is sent from.
Save and see that you can find your new domain under “Domains”. Click on the domain. Here you see an overview of what you need to do in order to get it up and running
Go to your domain and add the DNS records from your domain in Mailgun. You have to add the types TXT and MX to be able to send emails.
Go back to Mailgun, find your domain under “Domains”. This should now have a green checkmark.
Go to the dashboard and click “API keys”. You need the private API key to set up email settings in Appfarm. You also need the email domain (name found in “Domains”).
In Appfarm Create
Add the private API key as a Secret (Permissions > Secrets)
Go to Environment Config. The following has to be done in each environment.
Select Email provider Mailgun.
Email domain: “Name” from Domains on mail gun
Default Sender Address: This is what the sender in your email will look like. For instance default sender address can be: Human Resources human.resources@mydomain.com. Mydomain.com is the Email domain.
Mailgun API key: Choose the Secret you added in step 1.
Mailgun API key (deprecated): Add the private API key (necessary per may 2021, this dependency will be removed)
Mailgun region: This has to correspond with what you choose for your domain when you added it on mailgun.com
Amazon SES
Here's a short step-by-step guide for setting up your custom email account using Amazon SES as email provider.
On aws.amazon.com/ses/ and your domain
Sign up on https://aws.amazon.com/ses/
Navigate to SES (Simple Email Service)
Navigate to Configuration -> Verified Identities
Click "Create identity". You will need the Access Key ID and Secret Access Key
Set up your domain with "DKIM". Follow the instructions. This also requires setting up CNAME entries.
In Appfarm Create
Add the Secret Access Key as a Secret (Permissions > Secrets)
Go to Environment Config. The following has to be done in each environment.
Select Email provider Amazon SES.
Default Sender Address: This is what the sender in your email will look like. For instance, default sender address can be: Human Resources human.resources@mydomain.com. Mydomain.com is the Email domain.
AWS Access Key ID: Enter the Access Key ID (found in AWS)
AWS Secret Access Key: Choose the Secret you added in step 1.
AWS region: This has to correspond with what you chose for your domain when you added it on AWS. Example: us-east-1.
SendGrid
This guide assumes you have created a SendGrid account and configured your sender identity.
In SendGrid
In your SendGrid account, go to Settings > API Keys.
Click Create API Key.
Configure the API key. It must be configured with access to Mail Send.
Once the API key is created, record the value as it will not be shown again.
In Appfarm Create
In your Appfarm Solution, add the SendGrid API key as a Secret (Permissions > Secrets).
Go to Environment Config. (The following has to be done in each environment you wish to use SendGrid).
For Email provider select SendGrid.
For SendGrid API Key select the Secret you added in step 1.
For Default Sender Address enter an email address that matches your sender identity configuration in SendGrid. This value will be used as the sender (from name and address) in emails sent via Appfarm. It can be either an email only (for example,
human.resources@example.com) or a combined from name and email address within angled brackets (for example,Human Resources <human.resources@example.com>).
Microsoft 365
Appfarm supports sending email through your Microsoft 365 account using either the Microsoft Graph API or SMTP with OAuth 2.0. Both methods require an app registration in Microsoft Entra ID (Azure AD). The Graph API is the recommended approach — it is simpler to configure and does not require an Exchange Online license for the sending mailbox.
There are two transport methods to choose from:
Graph API (recommended)
HTTPS via Microsoft Graph
Application permission (Mail.Send)
No
SMTP
SMTP AUTH via smtp.office365.com
Application permission (SMTP.SendAsApp)
Yes, on the sending mailbox
Microsoft Graph API (recommended)
In Microsoft Entra ID
Go to the Azure portal and navigate to Microsoft Entra ID > App registrations.
Click New registration.
Give it a name (e.g. "Appfarm Email").
Set Supported account types to Accounts in this organizational directory only.
No redirect URI is needed.
After creation, note the Application (client) ID and Directory (tenant) ID from the Overview page.
Go to Certificates & secrets > Client secrets > New client secret. Record the secret value — it will only be shown once.
Go to API permissions > Add a permission > Microsoft Graph > Application permissions.
Add
Mail.Send.
Click Grant admin consent for your organization.
In Appfarm Create
Add the Client Secret as a Secret (Permissions > Secrets).
Go to Environment Config. The following must be done in each environment.
For Email Provider, select Microsoft 365.
For Microsoft 365 Client ID, enter the Application (client) ID from step 3 above.
For Microsoft 365 Client Secret, select the Secret you added in step 1.
For Microsoft 365 Tenant ID, enter the Directory (tenant) ID from step 3 above.
Check Use Microsoft Graph API.
For Default Sender Address, enter the sender address. This must be a valid mailbox or shared mailbox in your Microsoft 365 tenant. The format can be either a plain email (
noreply@example.com) or a display name with email (Human Resources <hr@example.com>).
SMTP
In Microsoft Entra ID
Follow steps 1–4 from the Graph API section above to create an app registration and obtain the Client ID, Tenant ID, and Client Secret.
Go to API permissions > Add a permission > APIs my organization uses > search for Office 365 Exchange Online > Application permissions.
Add
SMTP.SendAsApp.
Click Grant admin consent for your organization.
Register a service principal for the app and grant it permission to send as the desired mailbox. This requires Exchange Online PowerShell:
Good to know
<enterprise-app-object-id> must be copied from the Enterprise Applications blade in Entra, not from the App Registrations Overview page. The two pages display different Object IDs, and using the wrong one causes silent authentication failures when Appfarm attempts to send mail.
See Microsoft's documentation on SMTP AUTH with OAuth for full details.
In Appfarm Create
Add the Client Secret as a Secret (Permissions > Secrets).
Go to Environment Config. The following must be done in each environment.
For Email Provider, select Microsoft 365.
For Microsoft 365 Client ID, enter the Application (client) ID.
For Microsoft 365 Client Secret, select the Secret you added in step 1.
For Microsoft 365 Tenant ID, enter the Directory (tenant) ID.
Leave Use Microsoft Graph API unchecked.
For Default Sender Address, enter the sender address. This must match a licensed Exchange Online mailbox that the service principal has permission to send as. Format:
Human Resources <hr@example.com>orhr@example.com.
Authentication emails
Authentication emails — one-time PIN codes, login links, password-reset links and welcome/confirmation emails — are always sent from Appfarm's own domain by default. Because these emails carry credentials and password-reset links, they are not routed through an email provider connected to your Solution. As a result, connecting your own email provider (above) does not change the sender address of authentication emails.
You can still brand authentication emails in the following ways:
From Display Name and Reply-To address — set these in your Solution's login configuration.
Content and layout — see Add custom email templates.
If you need full control over authentication — including the sending domain — under your own brand, connect your own identity provider using a Custom Auth provider. See Login and Authentication.
Last updated
Was this helpful?