Now a lot of host space is IIS on the implementation of PHP programs, most of them can not directly use mail () to send mail, with this class as long as you have registered mailbox, you can send the mail at will, speed is not slow oh.
//******************************
smtp.php file
//
//******************************
<?php
Class SMTP
{
/* Public Variables * *
var $smtp _port;
var $time _out;
var $host _name;
var $log _file;
var $relay _host;
var $debug;
var $auth;
var $user;
var $pass;
* Private Variables * *
var $sock;
* Constractor * *
function smtp ($relay _host = "", $smtp _port = =, $auth = False, $user, $pass)
{
$this->debug = FALSE;
$this->smtp_port = $smtp _port;
$this->relay_host = $relay _host;
$this->time_out = 30; is used in Fsockopen ()
//*****************************************************************
*.php use the file, see clearly, how to use here
//
//*****************************************************************
?
Require (File_dir.) Smtp.php ");
$smtpserver = "smtp.xxx.com";//SMTP server
$smtpserverport =25;//SMTP Server Port
$smtpusermail = "xxxxx@xxx.com";//smtp user mailboxes for the server
$smtpemailto = "aaaaa@xxx.com";/sent to whom
$smtpuser = "xxxxx";//smtp server's user account
$smtppass = "xxxxx"; user password for//SMTP server
$mailsubject = "Test Subject";//Message subject
$mailbody = "
$mailtype = "HTML";//Message Format (html/txt), TXT to text message
$SMTP = new SMTP ($smtpserver, $smtpserverport, True, $smtpuser, $smtppass);//One of the true in this is to use authentication, otherwise authentication is not used.
$SMTP->debug = true;//whether to display the debug information sent
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.