Forums

wp mail function (3 posts)

  1. saiful_hoq
    Member
    Posted 2 years ago #

    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);

    ?>

  2. MAzCastro
    Member
    Posted 2 years ago #

    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 :)

  3. saiful_hoq
    Member
    Posted 2 years ago #

    Hi MAC

    Thanks for your suggestion. It helped partially but if get the actual soloution please let me know.

    Thanks
    saiful

Topic Closed

This topic has been closed to new replies.

About this Topic