Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting issue with HTML emails and 365 smtp adding = in middle of word. #4004

Open
jelle-burodeng opened this issue Jan 16, 2024 · 7 comments

Comments

@jelle-burodeng
Copy link

jelle-burodeng commented Jan 16, 2024

We send our emails through office365 via smtp. Somehow every 70-80 characters a character gets replaced by an equal sign such as below:

Dear C=ris Thank =ou for contacting us. We app=eciate that you’ve taken the time to write. If you=eed a response, we’ll get back to you as quickly as we can.

I''ve found other users are experiencing this too:
https://expressionengine.com/forums/topic/253810/formatting-issue-with-html-emails-and-365-smtp-adding-in-middle-of-word

And i've found a possible solution here:
https://stackoverflow.com/questions/13065695/codeigniter-smtp-email-message-characters-replaced-with-equal-signs
"once I put in the "$this->email->set_crlf( "\r\n" );" it worked immediately without any issues!!!"

I have seen this issue on this site both when it was on EE5 a few months ago, but also now that it's running on EE7.3.14

I changed line 169 in /ee/legacy/libaries/email.php to public $crlf = "\r\n"; which seems to solve this

There is a sense of urgency to this one sine it's affecting orders from an ecommerce site

@nep
Copy link

nep commented Jan 17, 2024

Old time emails used to sometimes be set to "quoted-printable" encoded -- among other things, they'd get an automatic line break every 75-ish characters and an = sign. I don't know why Office365 is requiring this... but.

There is a config override for this:
https://docs.expressionengine.com/latest/general/system-configuration-overrides.html#email_crlf

So you don't have to edit Core, you just have to set your config differently to handle the demands of your email setup.

@jelle-burodeng
Copy link
Author

Well... the config override for that is not working in my case.. The setting is selected both in the cp settings, as well as in the config but it's not working. After i edited the core if works as it should

@intoeetive
Copy link
Contributor

@jelle-burodeng are you using an add-on to send email, or you also have the issue when sending from EE Control Panel via Communicate tool?

From what I can tell, the email_crlf config override should work, but the code needs to call ee()->email->EE_initialize() and not just initialize - could the add-on be skipping that? Also it's required to use double quotes for the config value

@jelle-burodeng
Copy link
Author

We send emails through Freeform 3.0.5 and cartthrob 8.1. And for testing i sent a bunch through the native communicate form too.
I tried the config override too, but that seemed to have no effect.

@intoeetive
Copy link
Contributor

@jelle-burodeng does it work if you also set email_newline config override to save value?

So two config overrides both pointing to "\r\n"

@jelle-burodeng
Copy link
Author

I can't test that at this moment...

@dougblackjr
Copy link
Contributor

Didn't realize this issue was here, experiencing the same thing. Looks related to line length and Microsoft's extended charset.

Slack thread here: https://eecms.slack.com/archives/C04CUNNR9/p1717090238390409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants