appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

[Bug]-[232]: Encoding issue with SMTP plugin

Open sumitsum opened this issue 2 years ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Description

From community:

i would like to ask a question about the SMTP app. We are currently successfully sending mails with it, however there is a strange thing happening with umlauts. The header of the sent mail says:

Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
 
but the generated source code of the email clearly has ISO-8859-1 encoding:

bittet um R=FCckruf

the correct utf-8 quoted printable would look like such:

bittet um R=C3=BCckruf

are we missing something here, or should this be considered to be a bug?

are you seeing any issue with the email that is received at the other end ?

yes, Mail.app under latest macOS is not able to display the text correctly.
we tried to supply an html skeleton in which we supplied the ISO-8859-1 encoding as a charset directive, but that gained no success either.

Steps To Reproduce

TBD

Public Sample App

No response

Version

self hosted

Front logo Front conversations

sumitsum avatar Mar 14 '22 13:03 sumitsum

i would like to provide the actutal rendering from Mail.app as additional info:

image

miko007 avatar Mar 14 '22 13:03 miko007

reach 29

rohan-arthur avatar Apr 07 '22 15:04 rohan-arthur

Stats

Stat Values
Reach 29
Effort (months) 0.25

ajinkyakulkarni avatar Apr 11 '22 10:04 ajinkyakulkarni

@ajinkyakulkarni could you briefly explain what that means?

miko007 avatar Apr 11 '22 12:04 miko007

@miko007 - this is our internal experiment using the prioritization framework (called RICE scoring model). Please ignore the stats for now.

ajinkyakulkarni avatar Apr 11 '22 12:04 ajinkyakulkarni

There is another user who could be facing an issue due to this encoding-decoding issue with the SMTP plugin - https://discord.com/channels/725602949748752515/760761686549463060/974586845939793920

Hello. It's a very good app, so I'm trying various things.

I created and sent an inquiry form by referring to the URL below.
https://docs.appsmith.com/datasource-reference/using-smtp

Then the characters are garbled (??????) probably because of "Content-Type: text / html; charset = us-ascii" in the email.
I live in Japan.

Is there a way to change charset to utf-8?

Or is there any other solution?

Attaching some screenshots below

Screenshot 2022-05-13 at 11 49 50 PM Screenshot 2022-05-13 at 11 50 08 PM

danciaclara avatar May 13 '22 18:05 danciaclara

Another user reached out today about this issue - https://discord.com/channels/725602949748752515/1041710823644594286/1041710823644594286

danciaclara avatar Nov 14 '22 13:11 danciaclara

An EE user is also facing this issue.

ame-appsmith avatar Dec 05 '22 05:12 ame-appsmith

I have a similar issue trying to use text generated in the Rich Text Editor. It comes as HTML entities, and there is no way to decode this to UTF-8. as I can't create javascript elements to use the browser to do it. Would appreciate a solution, hoping this issue can also solve that!

Svarto avatar Jan 01 '23 19:01 Svarto

Same here, but depending on which mail tool i use. In gmail everything is fine but in thunderbird, special characters are shown as question marks.

antoine-gu avatar Jan 06 '23 00:01 antoine-gu

Any news on a fix yet? I have the same problem.

liebig avatar Jan 09 '23 07:01 liebig

I have a workaround for this:


_encode_utf8: (s) => {
	// Workaround https://stackoverflow.com/a/13691499/2620154
	// Note, however, that escape() and unescape() are deprecated.
  	return unescape(encodeURIComponent(s));
  },

compiledBody = compiledBody
				.replaceAll('ä', _encode_utf8('ä'))
				.replaceAll('Ä', _encode_utf8('Ä'))
				.replaceAll('ö', _encode_utf8('ö'))
				.replaceAll('Ö',_encode_utf8('Ö'))
				.replaceAll('ü', _encode_utf8('ü'))
				.replaceAll('Ü',_encode_utf8('Ü'))
				.replaceAll('ß', _encode_utf8('ß'));

Absolutely not the best way, but works for me.

liebig avatar Jan 13 '23 10:01 liebig

Tested on local and this looks good to me

prapullac avatar Feb 20 '23 10:02 prapullac