The smtp module can send html when the variable 'smtp_allowhtml' is set to TRUE.

I the code below in the webform_email_html_capable function to let the webform module send html by using the the smtp module.

@@ -3732,7 +3732,7 @@
     }
   }
   else {
-    return FALSE;
+    return variable_get('smtp_allowhtml', 0);
   }
 }
CommentFileSizeAuthor
#2 webform-smtp-1670728-2.patch633 bytesduellj

Comments

quicksketch’s picture

Status: Active » Needs work

Thanks! Though we should definitely check for both the variable and ensure that the module is enabled, since the variable can persist even after the module is turned off.

duellj’s picture

Status: Needs work » Needs review
StatusFileSize
new633 bytes

Here's a patch that checks if the smtp module is enabled and is setup for HTML.

quicksketch’s picture

Status: Needs review » Closed (works as designed)

Upon reviewing this patch, I don't think it's the right approach to solving this problem. SMTP module doesn't actually format e-mails as HTML. That option only prevents SMTP module from wrapping the plaintext version of an e-mail in an HTML wrapper. I think the right solution when using SMTP module is to also install HTML Mail or MIME Mail modules, both of which provide the formatting options for HTML e-mails. Then SMTP module is only responsible for sending the e-mail. As far as I can tell, both modules work with SMTP module.

MIME Mail: #132903: Mime Mail intergration: A bond between mimemail and smtp module?
HTML Mail: https://drupal.org/node/1200142