带有phpmailer的Gsuite电子邮件未将电子邮件发送到实时电子邮件地址

时间:2019-06-21 03:43:39

标签: php phpmailer digital-ocean

我已经设置了gsuite电子邮件,并希望将其用于我的网站在某人注册时发送的电子邮件等。我已经设置了phpmailer来做到这一点。

$email = new PHPMailer(); 
$email->Host = "stmp.gmail.com"; 
$email->SMTPDebug = 2; 
$email->SMTPAuth = true; 
$email->SMTPSecure = "ssl"; 
$email->Port = 465; 
$email->Username = "myemail@mydomain.com"; 
$email->Password = "password"; 
$email->AddReplyTo('myemail@mydomain.com', "My Email"); 
$email->SetFrom('myemail@mydomain.com', "My Email"); 
$email->AddAddress("email@gmail.com"); 
$email->AddAddress("email@live.com"); 
$email->Subject = "test email"; 
$email->MsgHTML("<a>This is test</a>"); 
$email->Send(); 

我试图更改电子邮件的主题/内容,也尝试了tls / 587,但它会将电子邮件发送到gmail,但无法发送,我想我不想错过。

1 个答案:

答案 0 :(得分:0)

原来,我的IP列在spamhaus中,与我联系后被清除。现在,我也在live.com上收到电子邮件。

enter image description here