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.

CommentFileSizeAuthor
#11 mailsystem.png4.58 KBpog21

Comments

ron williams’s picture

I 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.

checker’s picture

I 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.

Road Runner’s picture

Since 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.

checker’s picture

Thanks for your answer. I changed to http://drupal.org/project/phpmailer and can use mimemail with it.

www.make-me-a-website.net’s picture

If 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.

checker’s picture

Status: Active » Closed (works as designed)

@katoss
Have you tried this?

www.make-me-a-website.net’s picture

Yes 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).

lpalgarvio’s picture

works 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)

pog21’s picture

Thanks for the explanation!

liquidcms’s picture

yes, 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

pog21’s picture

StatusFileSize
new4.58 KB

That'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?

that0n3guy’s picture

#8 Works great. Thanks!

brightbold’s picture

Thanks 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.

timmarwick’s picture

Issue summary: View changes

+1 for #8 Thanks!

dxx’s picture

+1 for #8 AND #13.

gmrmedia’s picture

#8 work great :)

mlyno’s picture

Great post, great help thanks!

toddwoof’s picture

Updating 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.

bisonbleu’s picture

The 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:

Fatal error: require_once(): Failed opening required ‘/srv/bindings/0d24b6d90564bafea405f6c10863/code//srv/bindings/0d24b6d90564bafea405f6c10863/files/mailsystem/MimeMailSystem__SmtpMailSystem.mail.inc’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /srv/bindings/0d24b6d94404bafea405f6c10863/code/includes/bootstrap.inc on line 3227

Luckily, there's a fix for this here: https://www.drupal.org/node/1369736#comment-5644064

saru1683’s picture

#10 screenscast works.

Thank you.

beautifulmind’s picture

Many Thanks to #8 & #10, especially that screen shot you shared.
Nailed it.

Regards.

kaztur’s picture

Great thanks for #8 and #10. You solved my half day fighting.

lukasss’s picture

#5 working for my!

maxplus’s picture

Hi Thanks,
#8 made my outgoing emails with office 365 smtp back to html mails!

nico.knaepen’s picture

Solution #8 made my day, thnx!

giuvax’s picture

Solution #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?

khumbu’s picture

Number 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

quotientix’s picture

#5 and #8 worked great for me! Thanks!

alfthecat’s picture

Component: Code » Documentation

Lucky #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 :)

concretegannet’s picture

I 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?