开发者

php email send to multiple address not working

开发者 https://www.devze.com 2023-01-16 23:27 出处:网络
Hi friends why this is not working ? While doing print_r , $emails ( which is T开发者_运维知识库o) is not showing any emails. It\'s fine when i send to only one person.

Hi friends why this is not working ? While doing print_r , $emails ( which is T开发者_运维知识库o) is not showing any emails. It's fine when i send to only one person.

$mails = array('abc@gmail.com','123@email.com');
$emails = implode(",",$mails);

$from= 'abc@imail.com);
$subject = 'hello';
$body = 'test';
send_email($from,$emails,$body,$subject);


Try changing to

$mails = array('abc@gmail.com','123@email.com');
foreach($mails as $k=>$m){
  $mails =trim($mails[$k]);
}
$emails = trim(implode(", ",$mails));

$from= 'abc@imail.com';
$subject = 'hello';
$body = 'test';
send_email($from,$emails,$body,$subject);
0

精彩评论

暂无评论...
验证码 换一张
取 消