Title: Send emails from a custom domain
Author: WordPress VIP Documentation
Published: May 14, 2024
Last modified: May 28, 2025

---

 1. [WordPress on VIP](https://docs.wpvip.com/wordpress-on-vip/)
 2. [Email](https://docs.wpvip.com/wordpress-on-vip/email/)
 3. Send emails from a custom domain

#  Send emails from a custom domain

By default, transactional emails (e.g., password resets, user registration notifications)
are sent from the email address `donotreply@wpvip.com`. The default sender’s email
address can be overridden with an SMTP plugin or custom code to send emails from
a custom domain instead.

**Prerequisite**

To send emails from a custom domain:

 * [The custom domain must be added to the environment’s **Domains & TLS** panel](https://docs.wpvip.com/domains/map-a-domain/)&
   [verified](https://docs.wpvip.com/domains/verification/) in the VIP Dashboard.
 * [The domain’s DNS records _must_ be updated with the required SPF and DKIM setting values](https://docs.wpvip.com/domains/dns-records-for-email/).
   Emails sent in large quantities from custom domains additionally require DMARC
   setting values.
 * If the domain is being added solely for the purpose of sending emails (not for
   directing traffic to a site on WPVIP), the domain’s DNS does not need to point
   to VIP.

## Override the default sender’s email address with custom code

Use [the `wp_mail_from` filter](https://developer.wordpress.org/reference/hooks/wp_mail_from)
to programmatically override the default sender’s email address `donotreply@wpvip.
com` to an email address of a custom domain that has the required DNS records.

When using this filter, the priority must be set to a value greater than `1` to 
override [the default configuration of the sender’s email address in the VIP MU plugins](https://github.com/Automattic/vip-go-mu-plugins/blob/7769cc9a00fa6e700cf20990d4bf75229bc9b6b6/vip-mail.php#L27).

This code example demonstrates the use of the `wp_mail_from` filter to update the
default sender’s email address to the custom value `user@example.com`. The code 
shown in the example should be added to a file in the [`/client-mu-plugins` directory](https://docs.wpvip.com/wordpress-skeleton/client-mu-plugins-directory/).

/client-mu-plugins/example-file.php

    ```lang-php
    add_filter( 'wp_mail_from', function( $from ) {
        return 'user@example.com';
    }, 15 );
    ```

For WordPress multisite environments, the example code can be customized per-network
site by including conditional logic that will selectively apply variations of the
code to specific sites.

## Send bulk email from a custom domain

VIP’s infrastructure for message delivery is not intended for the distribution of
HTML emails, mailing list functionality, invitations to view or share content, notifications
of site activity, or other messages that are generated in bulk. For these types 
of emails, a Simple Mail Transfer Protocol (SMTP) server or an Email Service Provider(
ESP) should be used instead.

A third-party SMTP server or ESP can enable large quantities of email to be sent
from a custom domain.

**Prerequisite**

To send emails in large quantities from a custom domain:

 * [The custom domain must be added](https://docs.wpvip.com/domains/verification/)
   to the environment’s **Domains & TLS** panel in the VIP Dashboard.
 * [The domain must be verified](https://docs.wpvip.com/domains/verification/).
 * [The domain’s DNS records _must_ be updated with the required SPF and DKIM setting values](https://docs.wpvip.com/domains/dns-records-for-email/).
   Emails sent in large quantities from custom domains also require DMARC setting
   values.
 * If the domain is being added solely for the purpose of sending emails (not for
   launching a site) the domain’s DNS does not need to point to VIP.

### Integrate an SMTP server or ESP

An external SMTP server or ESP can be integrated with a plugin or custom code.

Most email service providers have WordPress plugins that allow their service to 
be integrated with a WordPress site. Email service provider plugins often provide
the option to alter the sender’s email address, and other email sending behavior
by using the service provider instead of the web server.

Customers who use an external email service should [evaluate plugin candidates](https://docs.wpvip.com/plugins/third-party-plugins/)
for these service integrations before enabling them in a production environment.

External email service providers can also be integrated with a site on the VIP Platform
via custom code that hooks directly into the `[phpmailer_init](https://developer.wordpress.org/reference/hooks/phpmailer_init/)`
hook which is also used by [VIP’s Automattic mail server integration](https://github.com/Automattic/vip-go-mu-plugins/blob/master/vip-mail.php).
For additional guidance and code examples for this type of integration, refer to
[PHPMailer’s wiki](https://github.com/PHPMailer/PHPMailer/wiki).

Last updated: May 28, 2025