?
/*
* Mail Send Class
* Author: More than a rookie
* Contact Email: KINGERQ at MSN DOT com
* Date Created: 2005-08-19
* Note: This category for the modified, forget the source of
*/
Class Smail {
Your SMTP server vendor, which can be a domain name or IP address
var $smtp = "smtp.163.com";
SMTP requires authentication setting of 1 does not require an authentication value of 0, now most of the SMTP service provider to verify, if not clear please contact your SMTP service provider.
var $check = 1;
Name of your email account
var $username = "";
Your email password
var $password = "";
This email must be an email on the sending server
var $s _from = "";
/*
* Function: Letter initialization settings
* $from the mailbox on your sending server
* $password Your email password
* $SMTP your SMTP server vendor, which can be a domain name or IP address
* $check SMTP requires authentication setting of 1 does not require an authentication value of 0, now most SMTP service providers have to verify
*/
function Smail ($from, $password, $smtp, $check = 1) {
if (Preg_match ("/^[^\d\-_][\w\-]*[^\-_]@[^\-][a-za-z\d\-]+[^\-") (\.[ ^\-][a-za-z\d\-]*[^\-]) *\. [A-za-z] {2,3}/", $from)) {
$this->username = substr ($from, 0, Strpos ($from, "@"));
$this->password = $password;
$this->smtp = $smtp? $SMTP: $this->smtp;
$this->check = $check;
$this->s_from = $from;
}
}
/*
* Function: Send mail
* $to Target Mailbox
* $from Source Mailbox
* $subject Message headers
* $message Mail Content
*/
function Send ($to, $from, $subject, $message) {
Connecting to a server
$fp = Fsockopen ($this->smtp, $errno, $ERRSTR, 60);
if (! $fp) return "Join Server failed". __line__;
Set_socket_blocking ($fp, true);
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.