Gmail API - plaintext word wrapping

后端 未结 2 884
天命终不由人
天命终不由人 2020-12-06 19:09

When sending emails using the Gmail API, it places hard line breaks in the body at around 78 characters per line. A similar question about this can be found here.

Ho

2条回答
  •  粉色の甜心
    2020-12-06 19:32

    Are you running the content through a quoted printable encoder and sending the encoded content value along with the header or expecting the API to encode it for you?

    Per wikipedia it seems like if you add soft line breaks with = less than 76 characters apart as the last character on arbitrary lines, they should get decoded out of the result restoring your original text.

    UPDATE

    Try sending with this content whose message has been quoted-printable encoded (base64 it):

    From: Example Account 
    To: 
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable
    Subject: This is a test!
    Date: Tue, 18 Oct 2016 10:46:57 -GMT-07:00
    
    Here is a long test message that will probably cause some words to wrap in =
    strange places.
    

提交回复
热议问题