将电子邮件发送给多个用户在PHP
问题描述:
可能重复:
How to send e-mail to multiple recipients from database query (PHP)
Sending mass email using PHP将电子邮件发送给多个用户在PHP
你好,
我想发送电子邮件给多则1000级的用户在PHP。任何人都可以帮助我告诉我吗?我怎么发送。我尝试使用PHP梅勒,但它给出了问题。
感谢, Jubin梅塔
答
首先:函数的mail()的PHP手册很详细了很多的例子......
这么看:
mail($to, $subject, $message, $header)
$to = "[email protected]";
//if you want add more
$to .= ", [email protected]";
//you can seperate the mails with ","
$subject = "";
$message = "Hello world!";
// for html-emails you must set the content-type-header
$header = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// so here we are, here you can add an return address
// and add Cc and Bcc, that are added addresses, they will also get the email, so email to multiple addresses
$header = 'Reply-To: [email protected]' . "\r\n";
$header .= 'From: Geburtstags-Erinnerungen <[email protected]>' . "\r\n";
$header .= 'Cc: [email protected]' . "\r\n";
$header .= 'Bcc: [email protected]' . "\r\n";
所以你可以通过用“,”分隔地址来添加地址,你不能在标题中添加抄送和密送以及更多。查看手册!
注意:抄送和密件抄送的区别在于,当您使用抄送时,所有地址都会看到您抄送的人,使用密件抄送时也是“密件抄送”,因此地址无法查看您要求的人员。
还有很多:http://stackoverflow.com/search?q=php+multiple+mail – 2011-04-08 13:40:52
告诉我们你做了什么以及实际的错误是什么。 – dnagirl 2011-04-08 13:41:07
提到你的问题 – 2011-04-08 13:42:44