PHP send mail to multiple email addresses

后端 未结 14 1380
盖世英雄少女心
盖世英雄少女心 2020-11-27 06:49

What code I should do change in this PHP script to send one email to more than 20 email addresses?



        
相关标签:
14条回答
  • 2020-11-27 07:12

    You can just write multiple email address to whom you want to send and pass it as the first argument. Example:-

    mail("FirstEmailId@ABC.com, SecondEmilId@XYZ.com","Subject","Message","From: EmailId@PQR.com");
    
    0 讨论(0)
  • 2020-11-27 07:13

    Fore readability sake in the code use an array and implode it to a comma separated string:-

    $recipients = array(
      "youremailaddress@yourdomain.com",
      // more emails
    );
    $email_to = implode(',', $recipients); // your email address
    $email_subject = "Contact Form Message"; // email subject line
    $thankyou = "thankyou.htm"; // thank you page
    
    0 讨论(0)
提交回复
热议问题