Invalid address: (From) error in WordPress

Your site refused to send an email before it started, because the address it was supposed to come from is not a valid email address. Nothing went out, no mail server was contacted, and your SMTP password and port were never involved. The clue is at the end of the error: the rejected address, which usually tells you where it came from.

The error as WordPress records it

WordPress passes the error to the wp_mail_failed action, where email logs and monitoring plugins pick it up. In our tests it read:

Invalid address:  (From): wordpress@localhost

or, with an empty address (note the trailing space):

Invalid address:  (From): 

There are two spaces after Invalid address: (WordPress’s translated text ends in a space and PHPMailer, the mail library WordPress bundles, adds another). After (From): comes the rejected address exactly as WordPress had it, so read the end of the line first. Older PHPMailer versions may show Invalid address: (setFrom) <address> instead, with the rejected address at the end; we did not reproduce that form.

What failed, and at which stage

WordPress checks the From address before any mailer sees the message. In wp_mail(), setting the sender comes before the phpmailer_init hook, where SMTP plugins apply their settings, and before any connection; a failed check stops wp_mail() there.

Unlike Could not connect to SMTP host, the mail server plays no part: in every failing test run, our test SMTP server logged no connection at all. In our test, PHPMailer’s SMTP debug log had no transcript, because the failure came before phpmailer_init and there was no conversation to log. (The following From address failed is a later-stage error: the server received the address and rejected it.)

The check is WordPress’s is_email(), which wp_mail() has used as PHPMailer’s address validator since WordPress 5.5. It wants a domain with at least one dot, so wordpress@localhost fails even though some validators accept it.

What causes it

We read 5 WordPress.org support threads since 2023 reporting a failed send with this error. None ends with a confirmed cause, so we do not rank causes. Reporters named an SMTP plugin’s From setting (in one, the rejected value was the literal text SMTP_FROM), a translation plugin whose language suffix appeared on the end of the address ([email protected]/en), and a plugin sending from the site’s default address.

In the lab we produced the error eight ways, in three families.

The default From on a host name with no dot. When nothing else sets a From address, WordPress uses wordpress@ plus the host of the site’s home URL (on multisite, the network’s), minus any leading www.. A site at http://localhost, or http://localhost:8080, gets wordpress@localhost, which fails.

A bad value from code or a plugin setting. The wp_mail_from filter lets code, or a plugin setting applied through it, replace the From address. It expects a bare address; an incomplete address, an empty string, or a name and address together each failed.

A form’s From field. Form plugins pass their From setting to wp_mail() as a From: header. We tested this with stand-in headers rather than a form plugin. An empty merge tag inside angle brackets failed with an empty address; a tag that was never replaced failed with the tag itself as the address.

How to tell which cause you have

Start with what follows (From): in the message.

After (From): Likely cause Where to look
wordpress@localhost, or wordpress@ and a host with no dot The default From, built from the home URL The home URL in Settings > General
A tag such as [your-email] or {field:email} A form merge tag that was not replaced The From field in that form’s notification settings
Nothing An empty merge tag inside angle brackets, or an empty wp_mail_from value The form’s From field, then any plugin or snippet that sets the From
Name <address> A name and address in the address-only wp_mail_from value Custom code, or a plugin’s From email field
An address ending in @, or with something added, such as /en A plugin that built the address wrongly The plugin that sends this email, or one that rewrites addresses
Anything else that is not a plain name@domain address, such as a placeholder word (SMTP_FROM) or a domain with no dot A plugin setting or snippet supplying a From value WordPress cannot use Your mailer plugin’s From email field, then any code that filters the From

The second signal is how widely it happens. The default From and a wp_mail_from filter apply to every email (unless the filter’s code picks which), so a generic test usually fails too. A form’s From field applies only to that form, so a generic test passes while the form fails.

One trap explains why one form works while another fails: a From: header with nothing after it and no angle brackets passes, because WordPress skips the empty value and uses its default address. The same empty field inside brackets fails.

The fix for each cause

None of these fixes involves credentials, ports or the mail host.

A host name with no dot

Set a From address on your real domain. A mailer plugin’s From setting works if applied through the wp_mail_from filter, as WP Mail SMTP does. Going by the order in wp_mail(), a plugin that sets the address only in phpmailer_init comes too late; we did not test mailer plugins. Without one, add a must-use plugin (a PHP file in wp-content/mu-plugins/):

<?php
add_filter( 'wp_mail_from', function () {
    return '[email protected]'; // a bare address on your domain
} );
add_filter( 'wp_mail_from_name', function () {
    return 'Example Shop'; // the name goes here, not in the address
} );

In our test, this filter turned the failing localhost site green, as did a home URL whose host has a dot. It replaces the From address on every email, forms included. On a local development site, the filter or a local mail catcher does the job. Changing the WordPress email sender covers the options.

A bad value from code or a plugin setting

Return a full address such as [email protected], with no name or angle brackets; the name belongs in wp_mail_from_name or the plugin’s From name field.

A form’s From field

Fix the tag name if it is misspelt or points to a field that no longer exists. Better, set the form’s From to a fixed address on your own domain and put the visitor’s address in Reply-To. That way every message comes from an address you control, and replies still go to the visitor. Setting a Reply-To address in contact forms has the steps for common form plugins.

Check that it stays fixed

Send a test from the form or plugin that failed, not only a generic test, and confirm it arrives; the delivery check guide covers that part.

nanoPost makes Email Check, a free plugin that sends a scheduled test, keeps the error text and links it to a page like this one; that catches the site-wide causes, not a broken form. For a form’s own From field, a mail logging plugin is the better fit: WP Mail Logging records each wp_mail() call and saves the wp_mail_failed error message on that call’s entry.

How we tested

We reproduced each cause on a test site sending through a test SMTP server we control; Email Check recorded the error that wp_mail_failed received, and a small test plugin set up each cause.

The limits: no form plugin was installed, so the form cases are stand-ins for what a form plugin passes; no SMTP mailer plugin set its own From; one PHP version; and the public reports are a small sample read the same day.

Tested on: WordPress 7.1.5, PHPMailer 7.1.1, PHP 8.3.6, 21 November 2026.

For other errors, the WordPress email troubleshooting guide sorts each by the stage it comes from.

Invalid address: (From) error in WordPress details
Short Definition
WordPress's error when the From address it was given is not a valid email address, such as wordpress@localhost, an empty value or an unreplaced form tag. WordPress rejects it before contacting any mail server, so nothing is sent.
Related Terms
smtp-field-manual