我创建了一个返回电子邮件地址数组的函数:
// returns all wanted email adresses
leweb_get_events_detail();
这是给定的数组:Array
(
[0] => mail@example.com
[1] => mail2@example.com
)
如何将此电子邮件添加到标题数组中,它看起来像这样?function leweb_send_mail_to_author() {
$to = leweb_get_events_detail();
$subject = \'The subject\';
$body = \'<strong>The email body content</strong>\';
$headers = array(\'Content-Type: text/html; charset=UTF-8\',\'From: Owner <owner@owner.com>\', \'BCC:mail@example.com\', \'BCC:mail2@example.com\');
wp_mail( $to, $subject, $body, $headers );
}