Skip to main content
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


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

Change FROM Address for All MainWP Emails

1

Install Custom Dashboard

Install the Custom Dashboard extension.
2

Open the extension

Navigate to MainWP > Extensions > Custom Dashboard.
3

Add the PHP code

Go to the PHP tab and add this code:
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' => '[email protected]',
    );
}
4

Customize the values

Replace the placeholder values:
  • 'Your Name' - The sender name recipients will see
  • '[email protected]' - 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:
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 ( '[email protected]' == $email && 'Daily Digest' == $subject ) {
        return array(
            'from_name'  => 'Custom Name',
            'from_email' => '[email protected]',
        );
    }
    // 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

ScenarioSolution
Brand all MainWP emailsUse the basic filter with your brand email
Separate addresses by typeUse conditional filter based on subject
Different sender for reportsCheck 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