I've been trying to modify wp_mail()'s sender e-mail address to the post or comment author's e-mail address for awhile.
Anyone know how this can be done?
function wp_mail($to, $subject, $message, $headers = '') {
if( $headers == '' ) {
$from = get_userdata($post->post_author);
$headers = "MIME-Version: 1.0\n" .
"From: ". $from->user_email ."\n" .
"Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";}
return @mail($to, $subject, $message, $headers);
}