Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Emails from your own address

Emails WordPress sends come from an address you choose instead of wordpress@yourdomain.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Email
  • Tested with WordPress 7.1

Before you switch it on: Replace hello@example.com with an address on your own domain.

It arrives switched off, even when you install its whole pack with "Switch on after installing".

PHP
<?php

add_filter(
	'wp_mail_from',
	static function ( $email ) {
		// Only replace the default wordpress@ address.
		return str_starts_with( $email, 'wordpress@' ) ? 'hello@example.com' : $email;
	}
);

Good to know

Use an address on your site’s domain, or emails may land in spam. An SMTP plugin or the SMTP snippet sets it as well.

In these packs

  • Email: Emails from your name and address, sent through SMTP, and fewer notification emails.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.