<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Within a custom module I am trying to send an email but it goes into the spam folder when the email is to a gmail email address. </div>
</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">I am using drupal_mail[1] and then I implement hook_mail[2] to add the subject, headers and body to the message array. The header is a Content-Type of text/html (see below), but if I don't include the headers in the message array then it does not go in the spam folder but then I can't use any html tags within the email body.</div>
</blockquote><div><br></div><div>John </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>[1]<br>
<a href="http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/6" target="_blank">http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/6</a><br>
[2]<br>
<a href="http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail/6" target="_blank">http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hook_mail/6</a></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> $headers = array(</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
'MIME-Version' => '1.0',</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> 'Content-Type' => 'text/html; charset=iso-8859-1',</blockquote>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> 'Content-Transfer-Encoding' => '8Bit',</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
'X-Mailer' => 'Drupal',</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> );</blockquote><div><br></div></blockquote>
</div><br clear="all"><div><br></div>-- <br>John J. Mitchell<br>