gwenmckee / gmail-delay-send

Automatically exported from code.google.com/p/gmail-delay-send
0 stars 0 forks source link

MIME text/plain part contains base64-encoded html instead of base-64-encoded plain text. #142

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write a mail following the tutorial. Do not use bold or italic or anything 
else: just a plain text following the @-line.
2. The mail is sent ok.

What is the expected output? What do you see instead?
The text/plain part is base64-encoded (it is ok) but it is the html that is 
encoded:

PGRpdiBkaXI9Imx0ciI+PGJyPjxkaXY+PGRpdj4uLi4gZGUgdm9pciBzaSDnYSBtYXJjaGU8YnI+
PC9kaXY+PC9kaXY+PC9kaXY+DQo=

gives

<div dir="ltr"><br><div><div>... de voir si ça marche<br></div></div></div>

instead of

... de voir si ça marche

The html part is ok.

What version of the product are you using?
8

Please provide any additional information below.

Original issue reported on code.google.com by gilles.p...@gmail.com on 30 Jan 2014 at 8:41

GoogleCodeExporter commented 8 years ago
I am experiencing the same issue and am noticing it when receiving email on an 
iPhone (prior to downloading full message).  I am planning on doing some tests 
with a self-hosted version of GmailDelaySend, but it looks to be line 280 of 
GmailDelaySend.js is using the "body" var for both plain text and html portions 
of the multipart message.  It should be easy enough to add another line earlier:

var plainbody = message.getPlainBody();
//getPlainBody() is available from Class GmailMessage -> 
https://developers.google.com/apps-script/reference/gmail/gmail-message

and use the plainbody var as the 3rd passed value of the GmailApp.sendEmail 
function on line 280.  Will let you know if I get a chance to test this out.

Original comment by sidthed...@gmail.com on 27 Aug 2014 at 7:07