如何向字符串中的多个电子邮件发送一条消息

问题描述 投票:-1回答:1

我有一个像这样的字符串:

  $email = '[email protected],[email protected],and [email protected]'; 
AND
  $msg = 'SEND these to each email above thanks';

在我的成就中,我希望能够将$ msg中的文本作为电子邮件发送到$ email示例中的每封电子邮件:

  $to = '[email protected]';
  $msg = 'SEND these to each email above thanks';
  $to = '[email protected]';
  $msg = 'SEND these to each email above thanks';
   $to = '[email protected]';
  $msg = 'SEND these to each email above thanks';



  foreach($email as $email)
  {
  $to = $email["to"];


   $subject = 'the subject';
   $message = '$msg';
   $headers = 'is this really? ';
   mail($to, $subject, $message, $headers);

   }

非常感谢您对我的解决方案的影响

php string email send
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.