0

I'm using Drupal core 8.9.3 and Mime Mail 8.x-1.0-alpha3.

I have installed MimeMail and implemented mymodule_mail hook.

The UI is set to use "Mime Mailer mailer". The UI for Mime Mail is configured to Not 'Link images only', and to use 'Full HTML'.

Emails are sent and display correct html with embedded image tags. However there is a problem with the image being MIME-encoded and included as a message attachment.

The below simplified email only has a paragraph tag enclosing an image tag with a test src as src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png".

Below is the raw email.

Please, any suggestions.

Date: Thu, 20 Aug 2020 01:46:23 +0000 (UTC)
Content-Transfer-Encoding: 7bit

This is a multi-part message in MIME format.

--e3e18d39bfaeb05c93e9fe993b85d9033ac7dadb1
Content-Type: multipart/alternative;
 boundary="caf5a2b1e29cb0704a73a98e3c656acf261f57860"
Content-Transfer-Encoding: 7bit


--caf5a2b1e29cb0704a73a98e3c656acf261f57860
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable



--caf5a2b1e29cb0704a73a98e3c656acf261f57860
Content-Type: text/html; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ww=
w.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf=
-8">
    <title>Mime Mail message template</title>
  </head>
  <body id=3D"mimemail-body" class=3D"announce-contact-message">
    <div id=3D"center">
      <div id=3D"main">
        <p><img alt=3D"google" src=3D"https://www.google.com/images/brand=
ing/googlelogo/1x/googlelogo_color_272x92dp.png" /></p>&#13;

      </div>
    </div>
  </body>
</html>

--caf5a2b1e29cb0704a73a98e3c656acf261f57860--

--e3e18d39bfaeb05c93e9fe993b85d9033ac7dadb1--
0

MimeMail is not MIME encoding url images in email

That's correct. Mime Mail is still in alpha and that feature isn't working correctly yet. If this feature is important to you please participate in the issue queue at https://www.drupal.org/project/mimemail

Images are usually only delivered as attachments if they are not publicly accessible on the server. A complete link to an external image should work just fine in any email client.

But let me also note that there is something going on that you didn't mention - the Mime Mail module will NEVER use 7-bit encoding, and will NEVER use quoted-printable encoding. So it's quite possible that you're doing something that breaks the behaviour of Mime Mail.

1
  • Thanks for the reply. I am programmatically sending the email, via mail manager and the hook mymodule_mail. For this test it is a simple one liner (image tag) for the message body. If I remove the paragraph tags and just use the image tag, the first 'Content-Transfer-Encoding: quoted-printable' is replaced with 'Content-Transfer-Encoding: base64' the rest of the raw output is the same. – grk Aug 20 '20 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.