📄 mail.php
字号:
<?
require_once(dirname(__FILE__).'/phpmailer/class.phpmailer.php'); //phpmailer
function SmtpMail($send_to_mail,$subject,$body,$extra_hdrs,$username){
$mail=new PHPMailer();
$mail->IsSMTP();
$mail->Host="mail.163.com";
$mail->SMTPAuth=true;
$mail->Username="username";
$mail->Password="password";
$mail->From="username@163.com";
$mail->FromName="username";
$mail->CharSet="UTF-8";
$mail->AddAddress($send_to_mail,"$username");
$mail->AddReplyTo("username@163.com","name");
$mail->IsHTML(true);
$mail->Subject=$subject;
$mail->Body="<html><head>
<meta http-equiv='Content-Language' content='zh-cn'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></head>
<body background>$body
</body>
</html>";
$mail->AltBody="text/html";
if (@ !$mail->Send()) {
$results=array("result"=>false,"message"=>$mail->ErrorInfo);
return $results;
}else{
$results = array("result"=>true,"message"=>"send success to {$send_to_mail}");
return $results;
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -