Introduction: This is a detailed page of PHP Group mail. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 325740 'rolling = 'no'>
All people who have sent emails know that the mailboxes requested from others cannot be sent to a group. Some people say that QQ is not a group? Yes, but you can only send up to 30 at a time! I can't send my QQ mailbox any more! Besides, there is no way to customize the mailbox format!
Let's talk about the traditional group mail method! If you don't write PHPProgramYou can choose to use group-sending software! Here we will only talk about PhP programs! As follows:
Mail. Class. php address: http://www.123lianjie.com/mail.class.txt
<? PHP
Include ("mail. Class. php ");
$ Scontent = date ("Y-m-d h-I-s ");
######################################## ##
$ Smtpserver = "smtp.tom.com"; // SMTP Server
$ Smtpserverport = 25; // SMTP server port
$ Smtpusermail = "c@tom.com"; // user email address of the SMTP server
$ Smtpemailto = "e421083458@163.com"; // to whom to send
$ Smtpuser = "C"; // User Account of the SMTP server
$ Smtppass = "3780292"; // SMTP server user password
$ Mailsubject = "Thank You For Your 2009 shopping holiday. Meet us at June 2010 and wish you a Happy New Year." // Email Subject
$ Mailbody = $ scontent; // mail content
$ Mailtype = "html"; // The email format (html/txt). txt is a text email.
######################################## ##
$ SMTP = new SMTP ($ smtpserver, $ smtpserverport, true, $ smtpuser, $ smtppass); // here, true indicates that authentication is used; otherwise, authentication is not used.
$ SMTP-> DEBUG = false; // whether to display the sent debugging information
$ SMTP-> Sendmail ($ smtpemailto, $ smtpusermail, $ mailsubject, $ mailbody, $ mailtype );
?>
If you use this method to send too many emails! The SMTP server may block you temporarily! Then you cannot send an email! How can this problem be avoided? No problem with setting up the mail server on your own!
Here we use winwebmail 3.7.7.3 to set up a mail server! All restrictions are recommended √! In this way, the mail server can be used to the maximum extent!
Find your own domain names! Make a second-level domain name pointing to the IP address of your mail server! Then bind the domain name to your mail server! Register multiple accounts with the above domain names! In this way, you are not just an SMTP server! Yes! You can bind the IP address of an ADSL user! Use routing for a ing! That's it! Test whether the server can be used normally!
If no problem exists! Let's write the PHP mass program!
Let's have a few questions first! 1. Do not send emails too quickly. 10 s is acceptable! 2. You can send emails by array so that you can easily add emails to the mailbox list! 3. Use different Sending addresses to send emails in turn! For more information, see the program!
<? PHP
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 ("all emails are sent! ");
$ 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 Server
$ Smtpserverport = 25; // SMTP server port
$ Smtpusermail = $ domain [$ I] [0]; // user email address of the SMTP server
$ Smtpemailto = $ email_arr [$ E]; // to whom
$ Smtpuser = $ domain [$ I] [1]; // User Account of the SMTP server
$ Smtppass = $ domain [$ I] [2]; // SMTP server user password
$ Mailsubject = "Thank You For Your 2009 shopping holiday. Meet us at June 2010 and wish you a Happy New Year." // Email Subject
$ Mailbody = $ scontent; // mail content
$ Mailtype = "html"; // The email format (html/txt). txt is a text email.
######################################## ##
$ SMTP = new SMTP ($ smtpserver, $ smtpserverport, true, $ smtpuser, $ smtppass); // here, true indicates that authentication is used; otherwise, authentication is not used.
$ SMTP-> DEBUG = true; // whether to display the sent debugging information
$ SMTP-> Sendmail ($ smtpemailto, $ smtpusermail, $ mailsubject, $ mailbody, $ mailtype );
?>
<SCRIPT>
Function gonext ()
{
SetTimeout ("location. href = 'sentmail. php? Id = <? PHP echo $ email_arr [$ E]?> ", 10000 );
}
</SCRIPT>
User <? PHP echo $ email_arr [$ E]?> Email sent successfully!
<SCRIPT> gonext () </SCRIPT>
More articles about "php group email"
Love J2EE follow Java Michael Jackson video station JSON online tools
http://biancheng.dnbcw.info/php/325740.html pageno: 13