[wp-hackers] Problem Passing option to 'From:' in wp_mail $header

Alex Cragg alex at mysoutham.com
Tue Oct 9 00:03:23 GMT 2007


hi,

this was previously working on 2.2.X, but since upgrade to 2.3, i can no 
longer get the From: part of the wp_mail header to be anything other 
than what is defined in pluggable.php.

I have tried removing the call for an option, and putting an email in 
hard, but still, the email is still sent from the address defined in 
pluggable.php

the plugin i am working on is at 
http://webdev.mysoutham.com/new-user-email-set-up/

the particular code problem is this:

$headers = "MIME-Version: 1.0\n" .
        "From: ". $user_email . "\n" .
        "Content-Type: text/html; charset=\"" . 
get_option('blog_charset') . "\"\n";

I am using wp_mail like this:

    @wp_mail(get_option('newuseremailfromaddress'), $subject, $message, 
$headers);

the from address is not set as per the From: section

Only emailing the list as it seems like a bug, having worked fine in 
2.2.X, but then 2.3 breaks. Also wondering if the changes to wp_mail in 
pluggable.php have anything to do with it, and if so if something needs 
changing either here, or in the core code. Sure its something simple.

Thanks

Alex


More information about the wp-hackers mailing list