So I’ve got a couple of different plugins which I’m attempting to change the from address of the email header. I’ve tried using the filters, but it’s simply sending the email as the admin user account on the site.
add_filter( 'wp_mail_from_name', 'my_mail_from_name' );
function my_mail_from_name( $name )
{
return "My Name";
}
add_filter( 'wp_mail_from', 'my_mail_from' );
function my_mail_from( $email )
{
return "test@dev.dcac.co";
}
I’ve tried setting an array, and passing that to wp_mail directly. And that doesn’t work either.
$header[] = 'From: "test" <test@dev.dcac.co>';
$header[] = 'Content-Type: text/plain'."\r\n";
Can anyone see what I’ve done wrong here? I’m stumped.
1 Answer
Here is a better WordPress SMTP mailer.
https://wordpress.org/plugins/postman-smtp/