Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Because i am unable to use mimemail (see bug #132903: Mime Mail intergration: A bond between mimemail and smtp module?),
i have installed HTML Mail and get it working.
To have mail also in plain text, i made a patch in smtp module (version = "6.x-1.0-beta3")
Index: smtp.module
===================================================================
--- smtp.module (revisione 3)
+++ smtp.module (revisione 686)
@@ -664,6 +664,14 @@
// Let the people know what is going on.
watchdog('smtp', 'Sending mail to: @to', array('@to' => $to));
+ // Let check if content type is HTML
+ if($mail->ContentType=='text/html'){
+ $altBody = drupal_html_to_text($mail->Body);
+ $mail->AltBody = $altBody;
+ }
+
// Try to send e-mail. If it fails, set watchdog entry.
if (!$mail->Send()) {
watchdog('smtp', 'Error sending e-mail from @from to @to : !error_message', array('@from' => $from, '@to' => $to, '!error_message' => $mail->ErrorInfo), WATCHDOG_ERROR);
Hope this help someone, while waiting to complete tasks in upsigned bug
Comment | File | Size | Author |
---|---|---|---|
smtp.patch | 864 bytes | eliosh | |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedThe current versions of HTML Mail and SMTP do not have this problem.