0

I'm using phpmailer to sending emails to users,but the email account which i send with to users,it wasn't created on the same hosting,it created on Office 365, I used SMTP authentication,when i sent emails to users they considered as spams_for example hotmail say :This sender failed our fraud detection checks and may not be who they appear to be . when i google the problem i found the following issues:

1) Email failed in SPF and DKIM checks: but on cpanel in email authorization,i make SPF and DKIM enabled, so as my hosting company mentioned "that help reduce the amount of spam." . Do i need to setup SPF and DKIM records manually at zone file?

2) My Hosting company advise to setup reverse DNS:but does this important for my problem?

Sending code :

 $mail = new PHPMailer(true);
 $mail->Host = "smtp.office365.com";
 $mail->Port       = 587;
 $mail->SMTPSecure = '';
 $mail->SMTPAuth   = true;
 $mail->Username = "xxxxxx";
 $mail->Password = "xxxx";
 $mail->SetFrom($from, 'Name');
  $mail->addReplyTo($from);
 $mail->SMTPDebug  = 2;
 $mail->SingleTo = true ;
 $mail->clearAllRecipients();

 for($i = 0 ; $i < count($to) ; $i++)
 {

     $mail->addAddress($to[$i]);

 }


  if(!is_null($cc))
  {
      foreach ($cc as $email)
      {
          $mail->addCC($email);
      }
  }


 $mail->Subject = $subject;
 $mail->IsHTML(true);
 $mail->MsgHTML($body);


 if(!$mail->send()) {
     //echo 'Message could not be sent.';
     echo 'Mailer Error: ' . $mail->ErrorInfo;
     //  return false ;
 } else {

     return true ;
 }

So what do you advise me?

  • Yes, you'll want SPF, DKIM, and reverse DNS. – ceejayoz May 31 '17 at 14:53
  • Have you considered using a program like swift mail http://swiftmailer.org/ or php mailer (http://phpmailer.worxware.com/) libraries? I would try that, in addition to making sure your RDNS is setup correctly. – Ryan Churchill May 31 '17 at 14:54
  • @RyanChurchill yes i''m using phpmailer depending on office 365 account,so i should to setup RDNS ? this will be done depending on a request to hosting company?or by myself? how can i get ptr record on cpanel? – Jaber Abdallatef May 31 '17 at 21:38
  • when i consulted hosting company they said:However, if you have one of the following hosting packages, you cannot use external SMTP servers to send e-mail: ----- some of packages my account belong to--- so does that mean:even i use SPF,DKIM,RDNS the emails will sorted as a spams,i remind you :i have office 365 account i used it to send emails using phpmailer – Jaber Abdallatef Jun 01 '17 at 07:20

0 Answers0