Title: wp_mail &quot;wordpress&quot; override
Last modified: August 20, 2016

---

# wp_mail "wordpress" override

 *  [luckdragon](https://wordpress.org/support/users/luckdragon/)
 * (@luckdragon)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-wordpress-override/)
 * I know that there are plugins out there that will override the default “wordpress@”
   when mail is sent, however, I’ve tried several of them and found that they override
   ALL emails sent by the site. this is undesirable as things like contact form 
   7 send mail as the user filling out the form rather than as the site (so you 
   can reply). I was wondering if there was a plugin, or a way to tweak a plugin
   to detect if it’s set, and only override it if it isn’t (like how the core does
   it). would be so much easier if the folks at WP would just make the from name
   and from address be a configurable option rather than having it hardcoded in 
   wp-includes/pluggable.php
 * thank you in advance.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-wordpress-override/#post-2842317)
 * By convention, functions in ‘pluggable.php’ can be overwritten by you. That is
   why they are “pluggable”. You can copy the function to, say, your functions.php,
   change it as you like, and it should work.
 * However, you also have the ‘wp_mail’, ‘wp_mail_from’, and ‘wp_mail_from_name’
   hooks (and some you don’t need) to work with.
 *  Thread Starter [luckdragon](https://wordpress.org/support/users/luckdragon/)
 * (@luckdragon)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-wordpress-override/#post-2842328)
 * right, however the wp_mail_from and wp_mail_from_name override all emails, I 
   don’t know how to pass the “from” information to them so that they can determine
   whether it’s set or not
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-wordpress-override/#post-2842336)
 * Put `var_dump(get_defined_vars());` in a function, hook it to ‘wp_mail_from’ 
   and see what you have to work with by default. Then try, for example, `global
   $_POST;` or `global $_REQUEST;` until you find something you can use. Then you
   build an if/elseif/else conditional, or a switch conditional.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp_mail "wordpress" override’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/wp_mail-wordpress-override/#post-2842336)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
