I tried SMTP and it does allow me to set up a different mail server (so very good so far) but it then prevented me from sending html mail. I am not sure where to post this as the modules involved are Simple News, Mail System, Mime Mail and SMTP. When selecting SMTP in the Mail System, Simple news sends out raw html. This also occurs using the simple contact form (under users) just raw html was sent there too - so it doesn't appear to be a Simple News problem.By raw I mean I see instead of a bold character. When the default mail system is selected it would send out stripped content meaning that I would see just the text with no html mark up at all.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | mailsystem.png | 4.58 KB | pog21 |
Comments
Comment #1
ron williams commentedI am definitely having an issue as a result of the SMTP module. Without SMTP installed, the messages sent appropriately, with SMTP certain message headers are stripped.
Comment #2
checker commentedI have the same problem with html_mail mail_system mailmime and smtp. If there is an image in the mail smtp can't send it. Without image it works. Sending it through PHP with image it works.
Comment #3
Road Runner commentedSince I wrote this I found a solution with following four modules
HTML Mail, Mail System, Simplenews and SMTP Authentication (Mime mail does not work). I can now use a different mail server (no throttling) and send html emails. That said, it is a solution that is somewhat problematic, there a four different modules and the developers don't really work together some are very responsive e.g. Simplenews guys others not so much. There are too many moving parts and for modules that have been around as long as these have there are still too many errors in basic functions and work flow. I have been searching and trying alternatives. I believe I have found one in Dadamail. It is Pearl based runs outside the Drupal directory in a folder residing in your public_html directory. It is self contained, the developer is responsive, can handle tens of thousands of names in a list and the look is customizable. It keeps a separate database and is not synched with Drupal which is no biggie since I created a Drupal block to allow email registrations. If you have questions PM me and I'll try to help.
Comment #4
checker commentedThanks for your answer. I changed to http://drupal.org/project/phpmailer and can use mimemail with it.
Comment #5
www.make-me-a-website.net commentedIf I am not mistaken this is working as intended, in the mail system admin, create a new class using mime for format() and smtp auth support for mail().
Then configure the mail system to use the newly created hybrid class. This is the purpose of the mail system module.
Comment #6
checker commented@katoss
Have you tried this?
Comment #7
www.make-me-a-website.net commentedYes and it solved the raw html problem, it triggered an encoding bug though. (SMTP Authentication Support try to parse the header of the emails to determine encoding and failed on mime headers, and I badly patched it by setting a default on utf8).
Comment #8
lpalgarvio commentedworks well!
Explaining little further, in detail:
- enable Mail System, SMTP and a HTML module (HTML Mail or MIME Mail)
- go to admin/config/system/mailsystem
- hit New Class
- select class HTMLMailSystem (HTML Mail) or MIMEMailSystem (MIME Mail) for format() method
- select class SmtpMailSystem for mail() method (DefaultMailSystem is drupal's method, with php mail)
- save
- select the new class created (ie, HTMLMailSystem__SmtpMailSystem) for module/setting intended (ie, Site-wide default MailSystemInterface class for all general mails) on Mail System Settings
- and save
if there are no other modules/settings on the list, you will need to add it manually at New Setting (ie, SimpleNews, Rules, etc)
Comment #9
pog21 commentedThanks for the explanation!
Comment #10
liquidcms commentedyes, solution in #8 works.. whoo hooo.. too bad so hard to find this info.
my solution uses:
- mimemail
- smtp
- mail system
and this screenshot shows set up: http://screencast.com/t/Sp7cpweM
Comment #11
pog21 commentedThat's interesting. I don't have the "mime mail module class" drop down on my mail system settings page (see attached).
Anyone know why that might be?
Comment #12
that0n3guy commented#8 Works great. Thanks!
Comment #13
brightboldThanks for the solution in #8! Totally solved the problem.
For anyone who's trying this, though, please note that there's a bug in the 7.x-2.x branch of Mail System that will cause a WSOD if you attempt this on a server where the files directory is symlinked to a location outside the Drupal install. So don't do this on a production site hosted on Pantheon or Acquia, for instance! Apply the patch in https://drupal.org/comment/6745472#comment-6745472 before you employ this solution if this situation applies to you.
Comment #14
timmarwick commented+1 for #8 Thanks!
Comment #15
dxx+1 for #8 AND #13.
Comment #16
gmrmedia commented#8 work great :)
Comment #17
mlyno commentedGreat post, great help thanks!
Comment #18
toddwoof commentedUpdating to the dev version as suggested in #8 / #13 (I used dev version of 2015-Aug-12) and then setting up the settings as in #10 fixed the problem for me, with one exception:
For the entityform notification in question, if there is a problem with the html in the email body field, instead of rendering broken html in the email or not rendering the broken part, it doesn't send the email at all.
Specifically, I was displaying a logo image in the email, but had been using a relative path to the image. This caused the email not to work, once we started using this module. Error was "missing email body."
After I changed the image path to the full url, it sends as expected.
Comment #19
bisonbleu commentedThe patch in #13 won't help if you tried solutions in #8 or #10 before applying the patch. On Pantheon, doing so results in a nasty fatal error:
Luckily, there's a fix for this here: https://www.drupal.org/node/1369736#comment-5644064
Comment #20
saru1683 commented#10 screenscast works.
Thank you.
Comment #21
beautifulmindMany Thanks to #8 & #10, especially that screen shot you shared.
Nailed it.
Regards.
Comment #22
kaztur commentedGreat thanks for #8 and #10. You solved my half day fighting.
Comment #23
lukasss commented#5 working for my!
Comment #24
maxplus commentedHi Thanks,
#8 made my outgoing emails with office 365 smtp back to html mails!
Comment #25
nico.knaepen commentedSolution #8 made my day, thnx!
Comment #26
giuvax commentedSolution #8 solved the html problem of the sent email, but the email got back to be go in spam folder, which I had solved using the SMTP module. Any clue?
Comment #27
khumbu commentedNumber 8 & 10 does the trick, but be aware of this issue Creating new class Mimemailsystem_SmtpmailSystem causes WSOD (
7.x-2.34)
https://www.drupal.org/node/2563443
So make sure you test it before doing it on a live site.
greets
Comment #28
quotientix commented#5 and #8 worked great for me! Thanks!
Comment #29
alfthecat commentedLucky #8!
Thank you @lpalgarvio for saving the (my) day!!!
Been so bold as to mark this for documentation... Don't have the guts to commit heresy re-open an old issue, though I think it should be :)
Comment #30
concretegannet commentedI just want to comment on this issue.
There is no problem in the smtpmail module.
HTMLMail on the other hand...
After you enable the SMTPMail module, it is clear you intend to use SMTP, and plain text emails from your Drupal site are sent that way.
Even *after* you have done so, HTMLMail continues to call the PHP mail function, which assumes you have a SMTP server on localhost. The default behaviour for HTMLMail should be to trust the setting you have made for plain text emails.
To solve the problem, you have to generate your own class which is not part of standard Drupal. To do so, you have to relax permissions so a user interacting with your Drupal site can generate executable PHP code. Isn't that a major security flaw?