I want to send the following fields to wp_mail
If i put all the emails in Email to
,Copy to
and Bcc to
in an array $emails
and pass it to wp_mail. How do i set the headers for cc and bcc in wp_mail?
$headers = 'From: Test <info@test.co.uk>' . '\r\n';
$headers.= 'Content-type: text/html\r\n';
$success = wp_mail( $emails, $subject, $message, $headers );
You can use an array to send all the info you need, thus:
You can get it programmatically, being
$copy_to
and$bcc_to
arrays of said form fields after splitting them by the comma you state in the inner field text, and having defined array$headers
: