SS 4.10 Emailing message content encoding

4.9.0@stable

Hello, Forgot Password to receive the reset link the Email with a reset link looks weird, see the email i received below.

_ –=swift_1643836910_99f1d5666009a5c0f80162894204f6db=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Admin,

Here is your password reset link for https://otagourology.co=
.nz/.

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

Hi Admin,

Here is your password reset link for https://mywebsite.co.nz/.=

=swift_1643836910_99f1d5666009a5c0f80162894204f6db=–_

// Include any relevant code. If you have a lot of code, link to a gist instead.

I don’t know how to fix it, but I can tell you that this is how the “Source” looks.
I test my form emails using smtp4dev in a docker container and when I receive the email in the inbox I get different tabs “View”, “Headers”, “Parts” and “Source”.
The “View” tab is the way you would expect the email to look like, the “Source” tab looks exactly how yours above.

Hopefully this triggers something for someone in order to help you.

Have you changed anything in the email.yaml ?

Thanks, Kim for your reply
I havent changed anything in email.yml file,
I got the same problems with email looking when i just dispatch email with pdf attached. all Pdfs are in BLOB format and the rest of the email is similar to restore password one.
I am not an advanced user so any tips will appreciate.

Hi nzvlad,
Any luck with that?
I now have the same problem. On the test server on one host it works perfectly fine, on another host it looks like yours…
SilverStripe 4.9 works on both hosts, version 4.10 must include some changes that it doesn’t.

The problems seems to be related to PHP’s mail function (or at least the impl of Swift Mailer with it). Try to change to SMTP transport, that fixed the problem for me.

Add this to app/_config/email.yml (create this file):

---
Name: myemailconfig
After:
  - '#emailconfig'
---
SilverStripe\Core\Injector\Injector:
  Swift_Transport:
    class: Swift_SmtpTransport
    properties:
      Host: smtp.host.com
      Port: <port>
      Encryption: tls
    calls:
      Username: [ setUsername, ['`APP_SMTP_USERNAME`'] ]
      Password: [ setPassword, ['`APP_SMTP_PASSWORD`'] ]
      AuthMode: [ setAuthMode, ['login'] ]

From: silverstripe-framework/index.md at 64a9c27d0176134fcb87888e9c4a8ff0619e808e · creative-commoners/silverstripe-framework · GitHub