PHP-Mailer代码
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP-Mailer代码相关的知识,希望对你有一定的参考价值。
Advance Mail function using php Mailer Class
<?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "smtp.domain.com"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Password = "password"; // SMTP password $mail->FromName = "Name"; $mail->Subject = "Here is the subject"; $mail->Body = "This is the <b>HTML body</b>"; $mail->AltBody = "This is the text-only body"; if(!$mail->Send()) { echo "Message was not sent <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Message has been sent"; ?>
以上是关于PHP-Mailer代码的主要内容,如果未能解决你的问题,请参考以下文章