0

I am using default PHP mailer function to send transactional email(HTML) to users like Signup, Account Created, order placed and so on, but some emails getting delivered to user and some are getting failed following is my code

$htmlContent = $this->load->view('email_template/checkout_signup_email.php',$user,TRUE);
enter $encoding = "utf-8";

// Preferences for Subject field
 $subject_preferences = array("input-charset" => $encoding,"output-charset" 
=> $encoding,"line-length" => 76, "line-break-chars" => "\r\n");

// Mail header
$email_from ="sales@mydomain.com";
$header = "Content-type: text/html; charset=".$encoding." \r\n";
$header .= 'From: Citation Builder Pro <sales@mydomain.com>'. "\r\n".           

'Reply-To: sales@mydomain.com' . "\r\n" .
'Return-Path: sales@mydomain.co' . "\r\n" ;
$header .= "MIME-Version: 1.0 \r\n";
$header .= "Content-Transfer-Encoding: 8bit \r\n";
$header .= "Date: ".date("r (T)")." \r\n";
$header .= iconv_mime_encode("Subject", $mail_subject, 
$subject_preferences);

// Send mail
mail($email, $subject,$htmlContent, $header );

If I check in cpanel > Track Delivery - Following content are showing in result column

SMTP error from remote mail server after end of data: 552 5.2.0 HyaPeobnUk9U1 :: ded :: Message rejected for spam or virus content :: Please include this entire message when

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
  • see this https://stackoverflow.com/questions/47259077/php-mail-going-for-spam/47262478#47262478 – helpdoc Nov 25 '17 at 06:59
  • Hi I tried to use SMTP but emails are getting delayed specially to gmail, Can you explain bit more about how to use dedicated IP with popular( in active conversation ) sender email ID – Onkar C Nov 25 '17 at 07:24

0 Answers0