I was using SMTP authentication and drupal mail module for sending HTML emails.
Suddenly emails are not going. Hence i disabled the SMTP module and directly send emails using drupal email but emails are not receiving in HTML format.
//Email hook function
function caps_lead_mail($key,&$message,$params) {
switch ($key) {
case 'send_link':
$message['headers'] = array_merge(
$message['headers'], array(
'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
'bcc' => $params['bcc'],
)
);
$message['subject']=t($params['subject']);
$message['body'][]=$params['body'];
break;
}
}
//Sending html email
$sender = "ce.com";
$subject ="Weekly Report of new profiles and visit log";
$message = '<h4>No new profiles and visit log </h4>';
$message .= "Note: This is auto generated Email please do not reply to this Email.";
$params = array(
'body' => $message,
'subject' => $subject,
'headers'=>'simple',
'bcc' => 'ce.com',
);
$to = "ce.com";
drupal_mail('caps_lead', 'send_link', $to, language_default(), $params, $sender, TRUE);'