pmpro_wp_mail_from

The Paid Memberships Pro pmpro wp mail from function.

Description

pmpro_wp_mail_from( $from_email ); 

Parameters (1)

0. $from_email
The from email.

Usage

  1. if ( !function_exists( 'pmpro_wp_mail_from' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/email.php'; 
  3.  
  4. // The from email. 
  5. $from_email = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_wp_mail_from($from_email); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/email.php  
  1. function pmpro_wp_mail_from($from_email) 
  2. // default from email wordpress@sitename 
  3. $sitename = strtolower( $_SERVER['SERVER_NAME'] ); 
  4. if ( substr( $sitename, 0, 4 ) == 'www.' ) { 
  5. $sitename = substr( $sitename, 4 ); 
  6. $default_from_email = 'wordpress@' . $sitename; 
  7.  
  8. //make sure it's the default email address 
  9. if($from_email == $default_from_email) 
  10. {  
  11. $pmpro_from_email = pmpro_getOption("from_email"); 
  12. if ($pmpro_from_email && is_email( $pmpro_from_email ) ) 
  13. $from_email = $pmpro_from_email; 
  14.  
  15. return $from_email;