require("class.phpmailer.php");
$mail = new PHPMailer()
$mail->From = "sender@gmail.com";
$mail->AddAddress("recipient@gmail.com"); // name is optional
$mail->AddReplyTo("sender@gmail.com");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
我不知道我需要添加哪些标头,以发送电子邮件而不是垃圾邮件,我该如何使用它?
//$mail->IsSMTP(); // is this necessary?
//$mail->Host = "some host ip"; // what i need to write here?
//$mail->SMTPAuth = true; // is this necessary to send email NOT as spam?
//$mail->Username = "test"; // and this?
//$mail->Password = "secret"; // and this?
一段时间谷歌搜索,我没有找到任何关于如何发送电子邮件而不是垃圾邮件的明确信息......有什么想法吗?