Setting the from in the header on a custom page doesn't work
-
I am trying to send a custom email using wp_mail function but it always shows as from the default email in the plugin configuration. Here is the code I am using to send the mail.
$ToEmail = 'REMOVED'; $EmailSubject = 'Depot Rquest'; $mailheader[] = "From: ".$current_user->display_name." <".$current_user->user_email.">\r\n"; $mailheader[] = "Reply-To: ".$current_user->display_name." <".$current_user->user_email.">\r\n"; $mailheader[] = "Content-type: text/html; charset=iso-8859-1 \r\n"; wp_mail( $ToEmail, $EmailSubject, $email_body, $mailheader );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Setting the from in the header on a custom page doesn't work’ is closed to new replies.