Modify the default email sender email address in WordPress

Source: Internet
Author: User
Tags wordpress blog
After WordPress is installed, a system email address and a sender are automatically created by default. the email address is a WordPress@yourblogname.com, and the sender is WordPress. Although we have set the system email address as another name in the background, the email recipient of our blog still sees the mailbox address as a system mailbox address and a sender automatically created by default after the WordPress@yourblogname.co WordPress is installed, the mailbox address is a WordPress@yourblogname.com, and the sender is WordPress. Even though we have set the system email address to another name in the background, the email recipient of our blog still sees the email address as a WordPress@yourblogname.com and the sender name as WordPress, which is confusing to the recipient, no one knows whether the sender of WordPress is Zhang San, Li Si, a man or a woman. It is important that emails sent from mailboxes like WordPress@yourblogname.com are easily considered spam and intercepted or directly thrown into the garbage bin.

To make your WordPress blog more professional, we strongly recommend that you modify the default email address and the sender name. Although we cannot directly modify it in the background, we can use other methods to achieve this goal. The following provides several methods for your reference.

1. create related function
Use a suitable text editor (do not use Windows Notepad) to open the functions. php file in the current topic folder, and then add the following code (add to the last?> Labels ):
Function new_mail_from ($ old ){
Return 'admin @ yourblogname.com ';
}
Function new_mail_from_name ($ old ){
Return 'blog name ';
}
Add_filter ('WP _ mail_from ', 'New _ mail_from ');
Add_filter ('WP _ mail_from_name ', 'New _ mail_from_name ');

2. modify the WordPress system file
Find the class_phpmailer.php file in the wp-uplodes folder under the root directory of WordPress installation, open and find the following code:
Public $ From = 'root @ localhost'; public $ FromName = 'root user ';
Change 'root @ localhost' (excluding single quotes) to your favorite email address, and change 'rootuser' (excluding single quotes) to the name of the sender you want.
Tip: This method involves changes to the system core file. the modified file will be overwritten in the system upgrade background, and the modification result will also be invalid. you need to modify it again, which is troublesome, we recommend that you use the plug-in (next step ).

3. use plug-ins
There are many plug-ins that can set the default email address sent by the WordPress system. here we only introduce the two plug-ins. you can visit the WordPress plug-in library through the link to view the usage instructions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.