php群发邮件

Jun 23, 2016 pm 02:31 PM

简介:这是php群发邮件的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=325740' scrolling='no'> 发过邮件的人都知道,从别人那里申请的邮箱,没法群发。有些人说QQ不是群发吗?对是可以,但只能一次性发30个以内!发多了QQ邮箱就发不出去了!再说也没有法自定义邮箱格式!

下面说一下传统群发邮件方法!你如果不会写 php程序你可以选择用群发软件!在这里我们先只讲 php程序!如下:

mail.class.php地址:http://www.123lianjie.com/mail.class.txt

include("mail.class.php");

$scontent = date("Y-m-d H-i-s");
##########################################
$smtpserver = "smtp.tom.com";//SMTP 服务器
$smtpserverport =25;//SMTP 服务器端口
$smtpusermail = "c@tom.com";//SMTP服务器的用户邮箱
$smtpemailto = "e421083458@163.com";//发送给谁
$smtpuser = "c";//SMTP服务器的用户帐号
$smtppass = "3780292";//SMTP服务器的用户密码
$mailsubject = "感恩2009,相约2010,导购泉城祝您元旦快乐";//邮件主题
$mailbody = $scontent;//邮件内容
$mailtype = "HTML";//邮件格式(HTML/TXT),TXT为文本邮件
##########################################
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = false;//是否显示发送的调试信息
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
?>

如果你用这种方法发的邮件过多!smtp服务器就有可能把你暂时屏蔽!这时你就无法发出邮件了!怎么避免这种问题呢?自己架势mail服务器就没问题了!

在这里我们的用WinWebMail 3.7.7.3来架设mail服务器!建议把所有限制全部√去!这样mail服务器就能得最大限度的应用!
找出自己的多个域名!分别做一个二级域名指向你的mail服务器IP!然后再再你的mail服务器上绑定上域名!然后用以上多个域名分别注册多个账号!这样子你就不只是一个smtp服务器了!是多个!adsl用户IP绑定问题大家都会吧!用路由做一个映射!就可以了!测试服务器是否能够正常使用!

如果没有问题了!我们就来写php群发程序了!

我们要先想几个问题!1.不要发邮件过快,10s可以吧!2.能按数组来发邮件这样方便加的入邮箱列表!3.轮流使用不同的发信地址来发送邮件!具体大家看程序吧!
include("mail.class.php");
session_start();
$email_arr = explode("|","421083458@qq.com");
//print_r($email_arr);
if(!isset($_SESSION['e']))
$_SESSION['e'] = 0;
if($_SESSION['e']>=count($email_arr))
die("全部邮件发送完毕!");
$e = $_SESSION['e'];
$_SESSION['e'] = $_SESSION['e']+1 ;
echo $e;
date_default_timezone_set('PRC');
$scontent = date("Y-m-d H-i-s");
$domain = array(
     "0"=>array("0"=>"k@mail.kemeishuma.com","1"=>"k","2"=>"3780292"),
     "1"=>array("0"=>"p@mail.penghuaji.org","1"=>"p","2"=>"3780292"),
     "2"=>array("0"=>"s@mail.smileshoping.cn","1"=>"s","2"=>"3780292"),
     "3"=>array("0"=>"1@mail.123lianjie.com","1"=>"1","2"=>"3780292"),
     "4"=>array("0"=>"c@mail.chunshuiji.org","1"=>"c","2"=>"3780292"),
     );
if(!isset($_SESSION['i'])||$_SESSION['i']>4)
$_SESSION['i'] = 0;
$i = $_SESSION['i'];
$_SESSION['i'] = $_SESSION['i']+1 ;
##########################################
$smtpserver = "mail.chunshuiji.org";//SMTP服务器
$smtpserverport =25;//SMTP服务器端口
$smtpusermail = $domain[$i][0];//SMTP服务器的用户邮箱
$smtpemailto = $email_arr[$e];//发送给谁
$smtpuser = $domain[$i][1];//SMTP服务器的用户帐号
$smtppass = $domain[$i][2];//SMTP服务器的用户密码
$mailsubject = "感恩2009,相约2010,导购泉城祝您元旦快乐";//邮件主题
$mailbody = $scontent;//邮件内容
$mailtype = "HTML";//邮件格式(HTML/TXT),TXT为文本邮件
##########################################
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
$smtp->debug = true;//是否显示发送的调试信息
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
?>
<script> <br />function gonext() <br />{ <br />setTimeout("location.href='sentmail.php?id=<?php echo $email_arr[$e]?>'",10000); <br />} <br /></script>
用户邮件发送成功!
<script>gonext()</script>

“php群发邮件”的更多相关文章 》

爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/325740.html pageNo:13
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

PHP Logging: Best Practices for PHP Log Analysis PHP Logging: Best Practices for PHP Log Analysis Mar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Customizing/Extending Frameworks: How to add custom functionality. Customizing/Extending Frameworks: How to add custom functionality. Mar 28, 2025 pm 05:12 PM

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Framework Security Features: Protecting against vulnerabilities. Framework Security Features: Protecting against vulnerabilities. Mar 28, 2025 pm 05:11 PM

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

See all articles