From Address includes site title

By: Stephen Walker | Asked: 05/18/2023
ForumsCategory: General questionsFrom Address includes site title
Stephen Walker asked 11 months ago
I am trying to understand why the "From address" on an email submission includes the name of the site even though an email address is the only thing in that field [id of email address]. If this is the default behavior, is there a way to remove that?
Attachments
Walter JonesWalter Jones replied 11 months ago

You you using a SMTP service in WordPress to send your email? Or the default wordpress php mailer?

Stephen Walker replied 11 months ago

Just the default

4 Answers
Best Answer
Rob LeVineRob LeVine answered 11 months ago
I just ran tests and indeed if you leave off the name, it puts in your site name automatically.  I then tried the above wp_mail_from_name filter, returning the blank string and it solves the problem, at least in this test situation. add_filter( 'wp_mail_from_name', function( $name ) { return ''; } );
Stephen Walker replied 11 months ago

Thank you for testing and confirming. I will give this filer a try.

Rob LeVineRob LeVine answered 11 months ago
You can look into using these filters to manually set the From, though it'll set the From for all of your emails.
https://developer.wordpress.org/reference/hooks/wp_mail_from/
https://developer.wordpress.org/reference/hooks/wp_mail_from_name/

btw, is your host GoDaddy?  GoDaddy and Formidable kind of have a hate-hate relationship when it comes to emails.
Stephen Walker replied 11 months ago

No, the host is not go daddy. Thanks for the information but setting the from address to be the same is the problem I am trying to solve. I probably wasn’t clear enough. The form value is there, but it injects the site name as well.

Rob LeVineRob LeVine replied 11 months ago

You can use the https://developer.wordpress.org/reference/hooks/wp_mail_from_name/ and set its name to "" although it might default back to your site name. I've honestly never run into this before.

Walter JonesWalter Jones answered 11 months ago
Can you give us a screen shot of your settings for the email notification?  

 
Stephen Walker answered 11 months ago
See attached image
Attachments

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right