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.
In SMTP Module, Send as HTML mail is wont working. It directly send the HTML tags in mails.
Comment | File | Size | Author |
---|---|---|---|
#21 | smtp-html-tags-mail-2771559-21.patch | 690 bytes | Chris Matthews |
| |||
#9 | smtp-html-tags-mail-2771559-9.patch | 538 bytes | maniosullivan |
#6 | smtp_html_tags_mail_2771559_6.patch | 638 bytes | arunkumark |
configure.png | 10.7 KB | vpsaravanan | |
issue_mail.png | 20.65 KB | vpsaravanan |
Comments
Comment #2
vpsaravanan CreditAttribution: vpsaravanan commentedComment #3
vpsaravanan CreditAttribution: vpsaravanan commentedComment #4
arunkumarkIn Need to change the header of mails as text/html.
I have created a patch thats works for me.
Comment #5
Nagarajan Kumar CreditAttribution: Nagarajan Kumar commentedHi,
The patch #4 not working.
Comment #6
arunkumarkHi,
I have made changes on patch and added headers in
hook_mail_alter()
function.Comment #7
arunkumarkComment #8
pazhyn CreditAttribution: pazhyn as a volunteer and at AnyforSoft, Drupal Ukraine Community for AnyforSoft commentedThere is a module for that - https://www.drupal.org/project/mimemail
Do we need to implement this in SMTP module?
Comment #9
maniosullivan CreditAttribution: maniosullivan commentedRerolled patch for 8.x-1.0-beta3.
Comment #10
NancyDruDoes this need to be backported to 7.x?
Comment #11
estoyausenteI think that is not a SMTP use case as @pazhyn say... but maintainers should decide.
Comment #12
NancyDruI am using MimeMail and it works fine with sending directly, but using SMTP to send through SendGrid is producing garbage.
Comment #13
estoyausenteRight now I'm using SMTP with mimemail and I'm sending HTML mails, but I don't remember if I had to did something special :-(
Comment #14
kevster CreditAttribution: kevster commentedIm having the same issue in version 7 - soon as I turn on the SMTP module I get markup printed out and no matter what I do with formats, overriding templates I cant sort it...
Also using commerce mail, HTMLMail
Comment #15
NancyDruThis was very helpful to me: https://www.drupal.org/node/1200142
Comment #16
nkoporecTested the patch from @maniosullivan and It's working perfectly, hope it gets committed soon since this is an important feature.
Comment #17
tepelena CreditAttribution: tepelena commentedHaving the same problem. Can we get this committed, please?
Comment #18
lor CreditAttribution: lor commentedHi, I have the same problem too and the patch #9 didn't solve my problem.
My config:
Formatter
Mime Mail mailer
Sender
SMTP Mailer
Theme to render the emails
Current
Could you fix it please?
Many thanks!
Comment #19
wundo CreditAttribution: wundo at Chuva Inc. commentedPer the comments above, this needs work.
Comment #20
bkosborneAs others have already said, I think this is NOT a feature the SMTP module should implement. The SMTP module should only be about transmitting the email that's given to it.
This setting in the UI is strange and confusingly worded. When that checkbox is DISABLED, this module actually strips out all HTML from emails that are sent. I have no idea why this feature exists, but I recommend that it simply be removed entirely. If it's kept, the wording should be updated to something like "Strip HTML from emails" and perform the opposite action it currently does. When checked, THEN it should remove the HTML from emails. The way it's currently worded implies that this module is actually adding the text/html mimetype header to emails, and it is not doing that.
Comment #21
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design commentedIn response to #20, how about this patch?
Comment #22
wundo CreditAttribution: wundo at Chuva Inc. commentedWith the latest dev I've encountered no problems sending HTML emails, can anyone confirm this is still happening?
And if so, could you please share how you're reproducing it (with which modules for instance)?
Comment #23
AmiOta CreditAttribution: AmiOta as a volunteer commented@wundo I can confirm that works.
I removed the module from disk and manually uncompressed the latest version and finally works.
Comment #24
KlemenDEV CreditAttribution: KlemenDEV as a volunteer and at Pylo commentedIn my case, the mail is sent via mail() and not SMTP mailer, although all other modules respect Mail System and use SMTP mailer to send email.
Comment #25
luli_schnauzer CreditAttribution: luli_schnauzer as a volunteer commentedMy mails are not working with html only when I add attachments, they work perfectly fine otherwise. The reason I found is in SMTPMailSystem.php, line 552:
When my message is of type 'multipart/mixed' (because of using attachments), the type of the body will be set as 'multipart/mixed' too and won't interpret html.
The tweak I made to solve it was to comment the last line and instead put
When I do that, attachments still work and the body of the mail will interpret HTML.
Is this a bug, or is there something I might be doing wrong?
Comment #26
luli_schnauzer CreditAttribution: luli_schnauzer as a volunteer commentedMy bad, I had installed email_attachment module that was setting the mime-type to multipart/mixed, but this interferes with this module.
Uninstalling it did the work.
Comment #27
SourabhBhalerao CreditAttribution: SourabhBhalerao as a volunteer commentedI also tried checkbox but email is coming with html tags and it is not working.