• saiful_hoq

    (@saiful_hoq)


    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

    (@fmacastro)

    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

    (@saiful_hoq)

    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.