Home  >  Article  >  Backend Development  >  Method 2 of sending emails in PHP 2. (SMTP transfer SMTP class call to send)_PHP tutorial

Method 2 of sending emails in PHP 2. (SMTP transfer SMTP class call to send)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:52:02837browse

[html]
require_once("email2.php");//This is method 2 of sending emails in php. (SMTP transmission SMTP class)
/**
*Server information
*/
$MailServer = 'smtp.163.com'; //SMTP server
$MailPort = '25'; //SMTP server port number Default 25
$MailId = 'anheng123@163.com'; //Server email account
$MailPw = 'xxxxxxxxxxx'; // Server email password

/**
*Client information
*/
$Title = 'System developer reports error message'; //Email title

$bt="sadfsadf";
$_POST['url']="afasdfasfasfsaf";
$_POST['lianxi']="12312412";
$_POST['xiangxi']="What I said is confusing but I feel like I have changed it";
$td=$subject.'
'.'Title:'.$bt.'
'.'url:'.$_POST['url'].'
'.'Contact Phone:'.$_POST['lianxi'].'
'.'Details:'.$_POST['xiangxi'];



$Content = $td; //Email content
$email = www.2cto.com target recipient email


$smtp = new smtp($MailServer,$MailPort,true,$MailId,$MailPw);
$smtp->debug = false;
if($smtp->sendmail($email,$MailId, $Title, $Content, "HTML")){
echo 'Email sent successfully'; //return result
} else {
echo 'Failed to send email'; //$succeed = 0;
}
?>
Author: Vericlongmore

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478150.htmlTechArticle[html] ?php require_once(email2.php);//This is method 2 of sending emails in php.( SMTP transmission SMTP class) /***Server information*/ $MailServer = smtp.163.com; //SMTP server $MailPort = 25; //SMT...
Statement:
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