0

I've been trying to send a text / plain email using the Gmail API for days and it always adds line breaks. I have tried the answer in this post Gmail API - plaintext word wrapping and it still does not work.

I send this text:

From: Example Account <example1@example.com>
To: <example2@example.com>
Content-Type: text / plain; charset = UTF-8
Content-Transfer-Encoding: quoted-printable
Subject: This is a test!

Here is a long test message that will probably cause some words to wrap in =
strange places.

However, it always comes to my tray as Content-Transfer-Encoding: 7bit and with annoying line breaks.

If I send it without the Gmail API as SMTP it comes as Content-Transfer-Encoding: quoted-printable correctly without line breaks.

Please, has anyone found a solution?

  • GMail is sending the text using `UTF-8` character encoding, as indicated in the content type. It is perfectly possible to send non-hard-wrapped plain text emails by using the `Quoted-Printable` encoding as defined by `RFC 2045`. In fact, Gmail already kind of supports this: it’s capable of decoding and displaying `Quoted-Printable-encoded` emails flawlessly, and it encodes HTML emails with it before sending them — it just doesn’t do the same thing for plain text emails (yet). `Content-Transfer-Encoding: quoted-printable` are used for "soft" line breaks. This is an intended behavior. – Jessica Rodriguez Mar 26 '19 at 14:34
  • OK, then I understand that there is not a solution to send the mail in the plain text without adding the line breaks through the Gmail API, however it is possible to do it through a traditional SMTP mail. – Esther Margarita Noa Rodríguez Mar 26 '19 at 15:08

0 Answers0