php - Having trouble sending an email to Cc using wp_mail() in Wordpress -


i able send email no issues, email not being cc'd after inputting in headers argument. missing in code below?

$to = 'myemail@example.com';  $subject = 'this email came site!';  $headers = array(      'content-type: text/html',      'cc: otheremail@example.com', );  $body = $_post['message']; $response = wp_mail( $to, $subject, $body, $headers );  

so issue needed add cc email in array in format

alias name <otheremail@example.com>

instead of email

otheremail@example.com.

now, email being cc'd properly.

complete working sample.

$to = 'myemail@example.com';  $subject = 'this email came site!';  $headers = array(      'content-type: text/html',      'cc: alias name <otheremail@example.com>', );  $body = $_post['message']; $response = wp_mail( $to, $subject, $body, $headers );  

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -