「Phpmailer」:修訂間差異
跳至導覽
跳至搜尋
新頁面: ==PHP mailer multiple address== <php> $mail->AddAddress('person1@domain.com', 'Person One'); $mail->AddAddress('person2@domain.com', 'Person Two'); //Better yet, add them as Carbon Co... |
|||
| 第10行: | 第10行: | ||
//To make things easy, you should loop through an array to do this. | //To make things easy, you should loop through an array to do this. | ||
//$mail->AddAttachment("filename"); // 設定附件檔檔名 | |||
$recipients = array( | $recipients = array( | ||
'person1@domain.com' => 'Person One', | 'person1@domain.com' => 'Person One', | ||
於 2017年2月14日 (二) 10:46 的最新修訂
PHP mailer multiple address
<php> $mail->AddAddress('person1@domain.com', 'Person One'); $mail->AddAddress('person2@domain.com', 'Person Two');
//Better yet, add them as Carbon Copy recipients.
$mail->AddCC('person1@domain.com', 'Person One'); $mail->AddCC('person2@domain.com', 'Person Two');
//To make things easy, you should loop through an array to do this. //$mail->AddAttachment("filename"); // 設定附件檔檔名 $recipients = array(
'person1@domain.com' => 'Person One', 'person2@domain.com' => 'Person Two', // ..
); foreach($recipients as $email => $name) {
$mail->AddCC($email, $name);
} </php>