admin管理员组

文章数量:1322695

When a user loses their password in WordPress, you are prompted to enter your email or username.

When the password reset email has been sent, it displays "wordpress" as a sender name. I want my website or blogname to replace that instead.

I would rather send my own personal email and link to the users my self, without sending anyone to the WP login page. On my website I have my own login page, and putting a lost password link there would fit me a lot better.

How can I have the "lost password" email that are sent to the users, display my blog name as the sender name, instead of "wordpress"?

Is it possible to have my own emails sent to the users that I can link to my login page thats on my site, not on the Wordpress login page?

When a user loses their password in WordPress, you are prompted to enter your email or username.

When the password reset email has been sent, it displays "wordpress" as a sender name. I want my website or blogname to replace that instead.

I would rather send my own personal email and link to the users my self, without sending anyone to the WP login page. On my website I have my own login page, and putting a lost password link there would fit me a lot better.

How can I have the "lost password" email that are sent to the users, display my blog name as the sender name, instead of "wordpress"?

Is it possible to have my own emails sent to the users that I can link to my login page thats on my site, not on the Wordpress login page?

Share Improve this question edited Apr 21, 2019 at 11:48 butlerblog 5,1013 gold badges26 silver badges43 bronze badges asked Jan 3, 2015 at 3:23 chugheschughes 111 silver badge2 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 6

If you have a custom login page already, you may not want to introduce a whole new plugin. You can change 'from' name and email with these simple functions in your theme or plugin.

To change the name

add_filter( 'wp_mail_from_name', 'custom_wpse_mail_from_name' );
function custom_wpse_mail_from_name( $original_email_from ) {
    return 'Yours Truly';
}

To change the email

add_filter( 'wp_mail_from', 'custom_wpse_mail_from' );
function custom_wpse_mail_from( $original_email_address ) {
    return '[email protected]';
}

If you want to use the same email address everywhere, you can simply set that in the general settings and change the name only. If you want to change it for just the password recovery, there are resets for the above functions that will return in to it's default settings. It's all in the codex. Here are a couple links to get you in the right direction:

https://codex.wordpress/Plugin_API/Filter_Reference/wp_mail_from_name

https://codex.wordpress/Plugin_API/Filter_Reference/wp_mail_from

If you want the email sender to change globally simply use "CB Change Mail Sender Plugin". Upon activation, you will notice a new menu item labeled CB Mail Sender in your WordPress admin bar. Clicking on it will take you to plugin’s settings page.You will need to enter the name and email address you want to be used for outgoing WordPress emails.

This plugin does not change the mail sender on a per context basis such as for password recovery emails only.

本文标签: