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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -