When you are still in the tangle php built-in mail () function can not send mail, then you are very lucky now, this article can help you!
PHP uses the SMTP class to send mail is very good, I used a long time, basically did not have a problem. This
PHP sends mail through SMTP through a class SMTP The code to send the message is as follows:
Require_once ' smtp.php ';
##########################################
$smtpserver = "smtp.sina.com";//SMTP server
Smtp email sending is much more practical than phpmail functions. The mail function does not allow you to send emails as needed, next, let's take a look at the smtp mail class and the solution to the problem. When you are still struggling with the
smtp.php
Copy CodeThe code is as follows:
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;
/*
A complete SMTP class of PHP (solve the problem when the mail server requires verification), read a complete SMTP class of PHP (solve the problem when the mail server requires verification), smtp. php? Phpclasssmtp {/* PublicVariables */var $
smtp.php
Copy CodeThe code is as follows:
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;
/*
Using DEDECMS to customize a Send mail php file, using the dedecms comes with mail.class.php, can be sent locally, after uploading to the server, prompted cannot connenct to relay host Smtp.qq.com Error: () error:cannot send email to [email
smtp.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 _
Smtp. php? Phpclasssmtp {* PublicVariables * var $ smtp_port; var $ time_out; var $ host_name; var $ log_file; var $ relay_host; var $ debug; var $ auth; var $ user; var $ pass; * PrivateVariables * var $ sock; * Constractor * functionsmtp ($
The SMTP (Simple Mail Transfer Protocol) is simply the message Transfer Protocol, which is a set of rules for sending mail from the source address to the destination, and it controls the way the letters are relayed. The SMTP protocol is a TCP/IP
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.