使用PHPMailer批量群发邮件
include(dirname(__FILE__) . '/../../lib/phpmailer/class.phpmailer.php');
$mailer = new PHPMailer();
$mailer->PluginDir = dirname(__FILE__) . '/../../lib/phpmailer/';
$mailer->IsSMTP();
$mailer->IsHTML(true);
$mailer->Host = 'mail.openkaku.jp';
$mailer->SMTPAuth = true;
$mailer->Username = 'fising';
$mailer->Password = '123456';
$mailer->From = 'webmaster@yourdomain.com';
$mailer->FromName = 'Shopex网站';
$mailer->CharSet = 'utf-8';
$mailer->Subject = 'mail_subject 邮件主题';
$mailer->Body = 'mail_body 邮件内容';
$mailer->AltBody = '需要支持HTML的邮件客户端才能正常显示';
// 分多次发送邮件
for( $i = 1; $i <= $times; $i++ )
{
$from = ( $i - 1 ) * INVITE_PERTIME;
$to = $from + INVITE_PERTIME - 1;
for( $j = $from; $j <= $to; $j++)
{
isset($returned_emails[$j]) && $mailer->AddAddress($returned_emails[$j][0],$returned_emails[$j][1]);
}
$mailer->Send(); // 发送邮件
}
类别:原创文章 | | 添加到搜藏 | 分享到i贴吧 | 浏览(454) | 评论 (0) 上一篇:【Adobe Flex官方教程】Flex 3 G... 下一篇:收藏一个FLEX技术论坛
$mailer = new PHPMailer();
$mailer->PluginDir = dirname(__FILE__) . '/../../lib/phpmailer/';
$mailer->IsSMTP();
$mailer->IsHTML(true);
$mailer->Host = 'mail.openkaku.jp';
$mailer->SMTPAuth = true;
$mailer->Username = 'fising';
$mailer->Password = '123456';
$mailer->From = 'webmaster@yourdomain.com';
$mailer->FromName = 'Shopex网站';
$mailer->CharSet = 'utf-8';
$mailer->Subject = 'mail_subject 邮件主题';
$mailer->Body = 'mail_body 邮件内容';
$mailer->AltBody = '需要支持HTML的邮件客户端才能正常显示';
// 分多次发送邮件
for( $i = 1; $i <= $times; $i++ )
{
$from = ( $i - 1 ) * INVITE_PERTIME;
$to = $from + INVITE_PERTIME - 1;
for( $j = $from; $j <= $to; $j++)
{
isset($returned_emails[$j]) && $mailer->AddAddress($returned_emails[$j][0],$returned_emails[$j][1]);
}
$mailer->Send(); // 发送邮件
}
类别:原创文章 | | 添加到搜藏 | 分享到i贴吧 | 浏览(454) | 评论 (0) 上一篇:【Adobe Flex官方教程】Flex 3 G... 下一篇:收藏一个FLEX技术论坛
顶(1)
踩(0)
- 最新评论