> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to change the FROM address for MainWP emails

> Change the sender address for MainWP email notifications using a PHP filter without affecting your WordPress administration email address.

By default, MainWP uses the **Administration Email Address** from your WordPress General Settings for email notifications. You can change the FROM address specifically for MainWP emails without modifying that WordPress setting.

## What You'll Learn

* How to customize the FROM address for MainWP emails
* How to change it for specific email types only

## Prerequisites

* [Custom Dashboard Extension](https://docs.mainwp.com/add-ons/development/mainwp-custom-dashboard-extension.md) (free)

***

## Default Behavior

MainWP uses the email address configured in **WP Admin > Settings > General** under **Administration Email Address**.

![WordPress General Settings page showing the Administration Email Address field](https://mintcdn.com/mainwp/4hVi87YDiCv3ZeGl/images/developers/email-from-address.png?fit=max\&auto=format\&n=4hVi87YDiCv3ZeGl\&q=85\&s=d2300fc158ff34b47492d9313f6f47af)

***

## Change FROM Address for All MainWP Emails

**1. Install Custom Dashboard**

[Install](https://docs.mainwp.com/dashboard/overview/manage-extensions.md#install-add-ons) the [Custom Dashboard Extension](https://mainwp.com/extension/mainwp-custom-dashboard-extension/).

**2. Open the add-on**

Navigate to **MainWP > Add-ons > Custom Dashboard**.

**3. Add the PHP code**

Go to the **PHP** tab and add this code:

```php theme={null}
add_filter( 'mainwp_send_mail_from_header', 'myhook_mainwp_send_mail_from_header', 10, 3 );
function myhook_mainwp_send_mail_from_header( $input, $email, $subject ) {
    return array(
        'from_name'  => 'Your Name',
        'from_email' => 'your-email@example.com',
    );
}
```

**4. Customize the values**

Replace the placeholder values:

* `'Your Name'` - The sender name recipients will see
* `'your-email@example.com'` - The email address to send from

**5. Save changes**

Click **Save Changes**. All MainWP emails now use your custom FROM address.

***

## Change FROM Address for Specific Emails Only

To customize the sender only for certain MainWP emails (e.g., Daily Digest), use this conditional version:

```php theme={null}
add_filter( 'mainwp_send_mail_from_header', 'myhook_mainwp_send_mail_from_header', 10, 3 );
function myhook_mainwp_send_mail_from_header( $input, $email, $subject ) {
    // Only change FROM for specific email/subject combinations
    if ( 'recipient@example.com' == $email && 'Daily Digest' == $subject ) {
        return array(
            'from_name'  => 'Custom Name',
            'from_email' => 'custom@example.com',
        );
    }
    // Return original for all other emails
    return $input;
}
```

Adjust the `$email` and `$subject` conditions to match the emails you want to customize.

***

## Common Use Cases

| Scenario | Solution |
| - | - |
| Brand all MainWP emails | Use the basic filter with your brand email |
| Separate addresses by type | Use conditional filter based on subject |
| Different sender for reports | Check for "Pro Reports" in subject line |

***

## Self-Check Checklist

* [ ] Custom Dashboard Extension installed
* [ ] PHP code added with your email details
* [ ] Changes saved
* [ ] Test email sent to verify new FROM address

***

## Related Resources

* [Dashboard Not Sending Emails](https://docs.mainwp.com/troubleshooting/my-mainwp-dashboard-not-sending-emails.md) - Email troubleshooting
* [Edit Email Templates](https://docs.mainwp.com/troubleshooting/why-cant-i-edit-email-templates-in-my-mainwp-dashboard.md) - Template customization
* [Custom Dashboard Extension](https://docs.mainwp.com/add-ons/development/mainwp-custom-dashboard-extension.md) - Extension documentation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.