Having trouble reading the text/html message part

后端 未结 3 1777
生来不讨喜
生来不讨喜 2021-01-02 03:11

I\'m trying to pull out the subject and body of an email with .Net. It seems to go OK except for the text/html MessagePart. I\'m not sure of the encoding etc - has anybody

3条回答
  •  Happy的楠姐
    2021-01-02 03:23

    The body data appears to be base64url-encoded, not base64-encoded. The difference is the use of - and _, instead of + and /, in the encoding’s alphabet of 64 characters. One solution is to replace all - and _ characters with + and / respectively, before calling FromBase64String.

    See http://tools.ietf.org/html/rfc4648#section-5

提交回复
热议问题