As MailMIME module depends on PEAR, basically it's incompatible with CiviCRM-enabled sites, also it seems to have issues with PHP 5.4 and later.
So I added a very simple plain text alternative that does not depend on mailmime module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aron Novak’s picture

Aron Novak’s picture

Eh, content-type definition is fixed here.

salvis’s picture

Thank you for your patch, Aron Novak — this looks reasonable and very useful!

Any reviewers/testers out there, please?

Aron Novak’s picture

https://www.drupal.org/u/mr.york pointed out that #2 can fail because of https://bugs.php.net/bug.php?id=68776 with PHP 5.x or newer
https://github.com/yohgaki/php-src/commit/89def6911128d8806fd10957a01833...

So under headers array, we should not add trailing newlines.

mr.york’s picture

Attached EOL fix patch.

salvis’s picture

Thank you for the improved patch, mr.york!

  1. +++ b/htmlmail.admin.inc
    @@ -184,6 +184,16 @@ function htmlmail_admin_settings() {
    +        '!mailmime' => l(t('Mailmime'), 'https://www.drupal.org/project/mailmime', array('attributes' => array('target' => '_blank'))),
    

    The module name is spelt "Mail MIME" and it must NOT be translated.

  2. +++ b/htmlmail.mail.inc
    @@ -120,6 +120,21 @@ class HTMLMailSystem implements MailSystemInterface {
    +
    

    Please remove the empty line.

I need a third party to review and test this patch — anyone, please!

Aron Novak’s picture

Rerolled and applied the requested change. I am far from 3rd party, but FYI we have this in production for a few weeks without any complaints.

salvis’s picture

Thanks!

What module(s) are you using for generating the emails? Are you by any chance using Subscriptions?

If you are, could this possibly be used for sending [subs:items:index:#0:formatted] as per #2534276: How to send HTML notifications?

  • Nafes committed 01c598b on 7.x-2.x authored by Aron Novak
    Issue #2484879 by Aron Novak, mr.york: Provide simple plain/text...
Nafes’s picture

Status: Needs review » Reviewed & tested by the community

Works perfectly for me. Just removed a redundant blank line near the end of changes. Thank you, Aron.

@salvis, can we mark the issue as fixed or you see some room for improvements?

salvis’s picture

Assigned: Aron Novak » Unassigned
Status: Reviewed & tested by the community » Fixed

@Nafes: If it works, it's great!

I'm happy to see you come on board, but how did this happen? I don't see any issue about you getting maintainer access. Would you please post an issue with a few lines to introduce yourself, and also add your name on the front page? (and in Mail MIME, too)

Nafes’s picture

As discussed, added my name on the front pages. Very happy to meet you, salvis!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.