PHPMailer发送到office.com中的垃圾邮件文件夹
我正在使用PHPMailer,它会将邮件发送到office.com的垃圾邮件文件夹中。如何使用PHPMailer将邮件发送到收件箱中。我想尽快完成这部分,但找不到任何帮助 下面是我的代码PHPMailer发送到office.com中的垃圾邮件文件夹,php,phpmailer,Php,Phpmailer,我正在使用PHPMailer,它会将邮件发送到office.com的垃圾邮件文件夹中。如何使用PHPMailer将邮件发送到收件箱中。我想尽快完成这部分,但找不到任何帮助 下面是我的代码 <?php require("email/class.phpmailer.php"); $mail = new PHPMailer(); $mail->SMTPDebug = 2; // enables SMTP debug information (
<?php
require("email/class.phpmailer.php");
$mail = new PHPMailer();
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls";
$mail->Host = "mail.google.com"; // sets the SMTP server
$mail->CharSet = "utf-8";
$mail->Port = 25; // set the SMTP port for the GMAIL server
$mail->Username = "abc@gmail.com"; // enter your email address
$mail->Password = "*****"; //enter your password
$webmaster_email = 'xyz@amatheon-agri.com'; //Reply to this email ID
$email= 'xyz@amatheon-agri.com'; // Recipients email ID
$name= 'Test Name'; // Recipient's name
$mail->From = $webmaster_email;
$mail->FromName = 'test';
$mail->AddAddress($email,$name);
$mail->AddReplyTo($webmaster_email,'test');
$mail->WordWrap = 50; // set word wrap
/*$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // attachment
$mail->IsHTML(true); // send as HTML*/
$mail->Subject = 'Test Mail1';
$mail->Body = 'message'; //HTML Body
$mail->AltBody = 'body'; //Text Body
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "<h2 align='center'>"."Your Suggestions has been sent to"." ".$name." "."having email"." ".$email."</h2>";
}
//$version= 0;
//echo $final;
/*$suggest= mysqli_query($con,"UPDATE sent_proposals SET In_Discussion = 1, accepted = NULL,declined = NULL WHERE proposal_id= '$proposal_id'");*/
?>
尝试添加:
$mail->isSMTP()代码>
尽管$mail->SMTPAuth=true代码>它可能未通过身份验证请尝试添加:
$mail->isSMTP()代码>
尽管$mail->SMTPAuth=true代码>它可能未通过身份验证它向我显示-2019-06-10 10:54:20 SMTP错误:无法连接到服务器:连接超时(110)SMTP connect()失败。邮件程序错误:SMTP连接()失败提供如下内容:$mail->Host
:ssl://smtp.gmail.com"; 代码>它仍然在junkHmm中运行。。这是因为您使用的是google
邮件服务,但您发送的邮件来自xyz@amatheon-agri.com
此电子邮件。邮件不受信任,因为反向DNS查找
它显示我-2019-06-10 10:54:20 SMTP错误:无法连接到服务器:连接超时(110)SMTP连接()失败。邮件程序错误:SMTP连接()失败提供如下内容:$mail->Host
:ssl://smtp.gmail.com"; 代码>它仍然在junkHmm中运行。。这是因为您使用的是google
邮件服务,但您发送的邮件来自xyz@amatheon-agri.com
此电子邮件。由于反向DNS查找