将邮件发送给多个收件人,而不使用 php 共享电子邮件 ID


Mail Sending to multiple recipient without sharing the email id using php

我有一个发送按钮,其ID是'btnEmail'。我的代码仅向指定的电子邮件发送邮件。我想将其发送给多个人而不共享电子邮件 id.My 代码在此处:

<?php
if(isset($_POST['btnEmail']))
{
       require_once("../include/phpmailer/class.phpmailer.php");
       $mail1 = new PHPMailer(); // create a new object
       $mail1->IsSMTP(); // enable SMTP
       $mail1->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
       $mail1->SMTPAuth = true; // authentication enabled
       $mail1->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
       $mail1->Host = "smtp.gmail.com";
       $mail1->Port = 465; // or 587
       $mail1->IsHTML(true);
       $mail1->Username = "some_mail@gmail.com";  // SMTP username
       $mail1->Password = "Sup3rS3cr3T"; // SMTP password
       $mail1->SetFrom("some_mail@gmail.com");
       $mail1->Subject = "Testing mail for php";
       $mail1->Body = "<html><h4>Tested Successfully</h4></html>";
       $mail1->AddAddress('another_mail@gmail.com');        
}

你似乎正在使用phpmailer。你检查过它给出的例子吗?

https://github.com/Synchro/PHPMailer/blob/master/examples/mailing_list.phps

这应该存在于您的计算机或服务器上。您也可以阅读文档,这很有帮助。