我在同一个函数中调用了两次wp_mail()函数,但另一个(第二个)没有发送。我错过了什么吗?
function v_send_mail() {
wp_mail( "[email protected]", $subject, $msg, $headers );
wp_mail( "[email protected]", $subject, $msg, $headers );
}
echo v_send_mail();
如果我改变他们的定位,第一封电子邮件将不会收到该电子邮件。有解决方案吗
试试这个代码。
function v_send_mail() {
$group_emails = array("[email protected]", "[email protected]" );
wp_mail($group_emails, 'my subject', 'my message', $headers);
}
if(v_send_mail()){
echo "mail sent";
}