Home > Backend Development > PHP Tutorial > 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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:52:02
Original
921 people have browsed it

[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...
source:php.cn
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template