Skip to main content

Email delivery configuration

The Ory Network provides a default SMTP server for sending emails. Ory emails are sent from this address:

{project.name} via Ory <no-reply@courier-eu.mg.oryapis.com>
info

To customize the sender address, sender name, and email content, you need to use your own SMTP server. This prevents abuse and ensures high deliverability rates.

Integrations​

Ory's email delivery system is flexible and can be configured to work with various email service providers. Below are the connection URIs and settings for some popular email service providers.

If a provider you use is not listed here, you can still configure Ory to use it by following the instructions in the Your own server section.

Need more flexibility?

Request an integration through our support channels or contribute one yourself by following the instructions on GitHub.

Sendgrid​

Use the following connection URI and settings to send emails using Sendgrid via SMTP.

  • Sender address: an email address for a domain that has been verified in SendGrid via Domain Authentication (See your available senders.)
  • Port: 587
  • Security Mode: STARTTLS
  • Username: apikey (constant string)
  • Hostname: smtp.sendgrid.net
  • Password: the API key created in SendGrid, with the full “Mail Send” permission (no other permissions needed)
  • SMTP Headers: none
smtp://apikey:<YOUR_SENDGRID_API_KEY>@smtp.sendgrid.net:587/

# For example:
smtp://apikey:SG.xxxxxxxx.xxxxxxxxx@smtp.sendgrid.net:587/

To configure Sendgrid as your email provider, go to Authentication → Email Configuration in the Ory Console.

Mailgun​

Use the following connection URI to send emails using Mailgun via SMTP.

Note: The username and password must be URI encoded.

smtp://{smtp-user}:{smtp-password}@smtp.mailgun.org:587

# For example:
# smtp://some-user%40mailgun.example.org:df2a2c4e-5caa-4f04-85b9-72d54a2468ad@smtp.eu.mailgun.org:587

AWS SES​

Use the following connection URI to send emails using AWS SES SMTP via SMTP.

Note: The username and password must be URI encoded.

smtp://{smtp-user}:{smtp-password}@email-smtp.{region}.amazonaws.com:587/

# For example:
# smtp://theuser:the-password@email-smtp.eu-central-1.amazonaws.com:587/

Postmark​

Use the following connection URI to send emails using Postmark via SMTP.

Note: The username and password must be URI encoded.

smtp://{YOUR_POSTMARK_SEVER_API_TOKEN}:{YOUR_POSTMARK_SEVER_API_TOKEN}@smtp.postmarkapp.com:587/

# For example:
# smtp://thetoken:thetoken@smtp.postmarkapp.com:587/

Brevo​

Brevo (formerly Sendinblue) is a European email platform with a strong GDPR posture, commonly used when EU-hosted email infrastructure is required.

Use the following connection URI to send emails using Brevo via SMTP relay:

smtps://<brevo-smtp-login>:<brevo-smtp-key>@smtp-relay.brevo.com:587

The SMTP login is your Brevo account email. The SMTP key is generated under Brevo → SMTP & API → SMTP (distinct from Brevo API keys).

To configure Brevo as your email provider, go to Authentication → Email Configuration in the Ory Console.

Mailchimp Transactional (Mandrill)​

Mailchimp Transactional (formerly Mandrill) is a paid add-on to Mailchimp for transactional email — a natural choice when Mailchimp marketing is already in place.

Use the following connection URI:

smtps://apikey:<md-mandrill-api-key>@smtp.mandrillapp.com:465

The SMTP username can be any string (Mandrill ignores it but it must be present — apikey is conventional). The password is your Mandrill API key from mandrillapp.com → Settings → SMTP & API Info.

Mailchimp Transactional is distinct from the Mailchimp marketing audience integration, which adds users to a Mailchimp list at registration via Ory Actions; see Mailchimp integration with Ory Actions.

SparkPost​

SparkPost (a Bird/MessageBird company) is an enterprise-grade transactional email platform with per-region US / EU hosting.

Use the following connection URI:

# US
smtps://SMTP_Injection:<sparkpost-api-key>@smtp.sparkpostmail.com:587

# EU
smtps://SMTP_Injection:<sparkpost-api-key>@smtp.eu.sparkpost.com:587

The SMTP login is the literal string SMTP_Injection for all customers. The password is your SparkPost API key with the Send via SMTP permission.

SparkPost separates US and EU accounts — pick data residency before integration; account migrations are not trivial.

Your own server​

You can send emails from your own SMTP server. Follow these steps to configure Ory to use a custom SMTP server:

  1. Go to Authentication → Email Configuration in the Ory Console
  2. Toggle the Advanced Settings switch
  3. Add the configuration for your SMTP server

SMTP security mechanisms​

SMTP has six different security mechanisms. Most SMTP services today use Explicit StartTLS with trusted certificates.

  1. Recommended: StartTLS with certificate trust verification. This is the most common option today:

    smtp://username:password@server:port/
  2. StartTLS without certificate trust verification:

    smtp://username:password@server:port/?skip_ssl_verify=true
  3. Cleartext SMTP uses no encryption and is not secure. This option is often used in development environments:

    smtp://username:password@server:port/?disable_starttls=true
  4. Implicit TLS with certificate trust verification:

    smtps://username:password@server:port/
  5. Implicit TLS without certificate trust verification:

    smtps://username:password@server:port/?skip_ssl_verify=true
  6. Implicit TLS with certificate verification which works if the server is hosted on a subdomain and uses a non-wildcard domain certificate:

    smtps://username:password@subdomain.my-mailserver.com:1234/?server_name=my-mailserver.com

Troubleshooting​

In general, if you have problems setting up email delivery, you can view outgoing messages on the Monitoring → Email Delivery page in the Ory Console.

note

The Sent state of an email only indicates whether Ory Identities successfully "handed" off the email to the SMTP server.

Emails do not arrive​

The best way to figure out, why an email did not arrive is checking the Email Delivery dashboard in the Ory Console. It will show all emails sent by your project, along with its delivery state. If the Ory Network could not reach your SMTP server or there was an authentication failure, it will be indicated here along with the error message.

If the email's status is Sent, but it did not arrive, please check the spam folder or the logs of your custom SMTP server (if configured).

Emails are marked as spam​

If you're using a custom domain, but no custom SMTP server, some (or all) emails the Ory Network sends, can be marked as spam or blocked by the email providers of your users, such as Gmail. This is due to the phishing/spam protection these providers have in place to protect their users.

To read more, see Automated Emails but in short: we recommend setting up a custom SMTP server, if you use custom domains.