require("class.phpmailer.php");
$mail = new PHPMailer()
$mail->From = "[email protected]";
$mail->AddAddress("[email protected]"); // name is optional
$mail->AddReplyTo("[email protected]");
$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";
我不知道需要添加哪些標題,才能將電子郵件作爲垃圾郵件發送,而我該如何使用它?php mail() - 作爲垃圾郵件發送(使用php郵件庫)
//$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?
有一段時間googling,我沒有找到任何明確的信息關於如何發送電子郵件不作爲垃圾郵件......任何想法?
現在我試圖發送電子郵件至[email protected] - 但它是像發送垃圾郵件,我該怎麼辦?有沒有關於如何避免這些問題的CLEAR信息? –
不幸的是,您目前使用的郵件服務器可能在過去發送垃圾郵件。您是否在共享託管計劃? –