wp_mail function headers

I would to customize the sender of the email so I am trying to set properly the headers of the email.

This is the cose I use to customize the headers:

Read More
$current = wp_get_current_user();
global $user_email;
get_currentuserinfo();
$headers_mail = "From: ".$current->first_name." ".$current->last_name." <".$user_email.">" . "rn";

and this is the cose I use to send the email:

wp_mail($email, $subject, $message, $headers_mail);

Unfortunately the sender of the email is always set to “WebsiteTitle ” where WebsiteTitle is an alias for the real title of the website and mydomain.com is an alias for the real domain of the website.

How can I overwrite the headers of the email? Is there any filter that I should use?

Related posts

Leave a Reply

2 comments