I am sending Emails with images, link and formatted text in $body. It's working fine until one of customer received broken email. I couldn't find solution. Please don't delete my question as i coundn't comment any post due to less reputation. Below is my code.
Do i have to add header in email, if yes and then can anyone tell me how to add header to following email?
$mail = new PHPMailer;
// use SMTP or use mail()
if (EMAIL_USE_SMTP) {
// Set mailer to use SMTP
$mail->IsSMTP();
$mail->Mailer = 'smtp';
$mail->IsHTML(true);
$mail->SingleTo = true;
// Enable SMTP authentication
$mail->SMTPAuth = EMAIL_SMTP_AUTH;
// Enable encryption, usually SSL/TLS
if (defined(EMAIL_SMTP_ENCRYPTION)) {
mail->SMTPSecure = EMAIL_SMTP_ENCRYPTION;
}
// Specify host server
$mail->Host = EMAIL_SMTP_HOST;
$mail->Username = EMAIL_SMTP_USERNAME;
$mail->Password = EMAIL_SMTP_PASSWORD;
$mail->Port = EMAIL_SMTP_PORT;
} else {
$mail->IsMail();
}
//specify mail details
$mail->From = CUSTOMER_LEAD_SUBMIT_FROM;
$mail->FromName = CUSTOMER_LEAD_SUBMIT_FROM_NAME;
$mail->AddAddress($customerEmail);
$mail->Subject = $subject;
$mail->Body = $body;
if(!$mail->Send()) {
$this->errors[] = MESSAGE_VERIFICATION_MAIL_NOT_SENT . $mail->ErrorInfo;
return $this->errors;
}
else{
return TRUE;
}