Title: wp mail function
Last modified: August 19, 2016

---

# wp mail function

 *  [saiful_hoq](https://wordpress.org/support/users/saiful_hoq/)
 * (@saiful_hoq)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp-mail-function/)
 * Hi
 * I have the following code for mail. But when I check mail then I can see “WordPress”
   under from section. HOw could I see the name of the actual sender under from 
   section?
 * Could anybody please help me?
 *  <?php //$to = $Your_Friend_Email;
 *  $admin_email = get_bloginfo(‘admin_email’);
 *  $to= $admin_email;
    $subject=$Subject;
 *  $headers = ‘From: ‘. $Your_Email . “\r\n” .
    ‘Reply-To: ‘. $Your_Email . “\r\
   n” . ‘X-Mailer: PHP/’ . phpversion();
 *  $headers .= ‘MIME-Version: 1.0’ . “\r\n”;
    $headers .= ‘Content-type: text/html;
   charset=iso-8859-1’ . “\r\n”; wp_mail($to, $subject, $requested_body, $headers);
 * ?>

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

 *  [MAzCastro](https://wordpress.org/support/users/fmacastro/)
 * (@fmacastro)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp-mail-function/#post-1271313)
 * I’ve hade similar issues and i’ve mannaged to fix them with this hack, that replaces
   the word WORDPRESS by the website’s URL:
 * goto **wp-includes/pluggable.php**
    goto **line 351** **Find:**
 *     ```
       if ( !isset( $from_name ) ) {
       		$from_name = 'WordPress';
       	}
       ```
   
 * **Replace with:**
 *     ```
       if ( !isset( $from_name ) ) {
       		$from_name = $sitename = strtolower( $_SERVER['SERVER_NAME'] );
       	}
       ```
   
 * It might not be the perfect way to do it, but at least solves the problem.
 * Perhaps someone reads this and provides a better solution helping us both 😉
 * MAC 🙂
 *  Thread Starter [saiful_hoq](https://wordpress.org/support/users/saiful_hoq/)
 * (@saiful_hoq)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/wp-mail-function/#post-1271372)
 * Hi MAC
 * Thanks for your suggestion. It helped partially but if get the actual soloution
   please let me know.
 * Thanks
    saiful

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

The topic ‘wp mail function’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [saiful_hoq](https://wordpress.org/support/users/saiful_hoq/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/wp-mail-function/#post-1271372)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
