In a previous post, I discussed the ease of filtering the “from” address that wp_mail will send email from. This was done using a filter added to your theme’s functions file (functions.php). I always prefer using the functions file for simple filters and actions as a plugin is often overkill for what is necessary.
But what if you are a person that prefers the ease of loading a plugin to do your bidding? Well, adding these filters as a plugin is as simple as taking those filters, applying the appropriate plugin header, saving it as a php file, and loading it to your plugins folder.
Note: this particular process does not make use of admin panels to make edits. This would add considerable unnecessary bloat to the file. Simply edit the returned values for email address and name in the file prior to saving. This results in a light weight and efficient plugin.
I have created the needed code for this “quick-and-dirty” plugin. To implement, follow these steps:
- Save this file as a .php file.
- Open it in your favorite editor (or notepad).
- Change the email name and address in the functions to the name and address you want your email coming from.
- Save your changes.
- Load to your plugin folder.
There are several other plugins that accomplish this with more features, so if that is what you are looking for, by all means, search the wordpress.org plugin directory. But if you want something simple and light, this will do it.