I ran into an issue where I needed to control the name and email address that WordPress used to send out mail using wp_mail. In researching this issue I was also able to find a way to manually set the content type of the email that was getting sent out, allowing you to control the content type in said email. In the code example it changes the name if one was not set or is using the default WordPress. It also changes if no email is set to use what you specify. If you want to change it for all outbound emails you can comment out the if ($email == ”) line. As well as the outbound email, if you want it to always be changed you can comment out the if statement.


%d bloggers like this: