WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] two different mails from the same sendmail (6 posts)

  1. kanika
    Member
    Posted 1 year ago #

    Hi,

    I tried using the send-from plugin to change the send-from name. But from the contact-us form(which is customized), it still comes as message-noreply.

    The function called is in email.php where the code looks like:

    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: message-noreply@example.com\r\n";
    
    $headers .= "BCC:";
    $headers .= $emailBcc;
    $headers .= "\r\n";
    
    if(@mail($recipient, $subject, $mailBody, $headers))
    	{
    		return TRUE;
    	}
    	else
    	{
    		return FALSE;
    	}

    How can I change the From name?

  2. wildlandart
    Member
    Posted 1 year ago #

    I don't know , but someone may be, your problem is big :D

  3. kanika
    Member
    Posted 1 year ago #

    By the way I forgot to add that i had tried editing this file and changing the from header

    From: XYZ<message-noreply@example.com>\r\n

    It didnt work.
    I had thought that the from name header would be different bit apparently it isnt.
    As far as the problem is concerned, i dont know how big or small it is. If u wish, you can make fun of that one. :)

    thanks,
    Kanika.

  4. David Choi
    Member
    Posted 1 year ago #

    See if this works

    $headers .= "From: message-noreply@example.com X-Mailer: PHP/" . phpversion();

    also check with your host if CC and BCC is blocked to prevent spam.

  5. kanika
    Member
    Posted 1 year ago #

    Thank you,

    the code above works.

  6. David Choi
    Member
    Posted 1 year ago #

    You are welcome. Glad it worked for you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags