2011-04-08 139 views
-2

可能重複:
How to send e-mail to multiple recipients from database query (PHP)
Sending mass email using PHP將電子郵件發送給多個用戶在PHP

你好,

我想發送電子郵件給多則1000級的用戶在PHP。任何人都可以幫助我告訴我嗎?我怎麼發送。我嘗試使用PHP梅勒,但它給出了問題。

感謝, Jubin梅塔

+1

還有很多:http://stackoverflow.com/search?q=php+multiple+mail – 2011-04-08 13:40:52

+0

告訴我們你做了什麼以及實際的錯誤是什麼。 – dnagirl 2011-04-08 13:41:07

+3

提到你的問題 – 2011-04-08 13:42:44

回答

3

首先:函數的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"; 

所以你可以通過用「,」分隔地址來添加地址,你不能在標題中添加抄送和密送以及更多。查看手冊!

注意:抄送和密件抄送的區別在於,當您使用抄送時,所有地址都會看到您抄送的人,使用密件抄送時也是「密件抄送」,因此地址無法查看您要求的人員。

相關問題