chadxz / imap-simple

Wrapper over node-imap, providing a simpler api for common use cases
MIT License
243 stars 80 forks source link

'Retrieve body context example' fails #69

Closed mikemaccana closed 3 years ago

mikemaccana commented 4 years ago

Using the https://github.com/chadxz/imap-simple#retrieve-body-content example as-is, the following is logged:

G(:{M#/zW]uS                                                                                                           5w0D[Mz *'5imy:ZG^/a'rb
."WzbV(W'7dr%k^F_i('r+1k
{mt[M=_^y_}}su[Nu_O;g/:X*'5imy<)zW17xmPN      6%
{
N"f"v&yZ0Zwibl\"l27
K^-gm:.MJ))da{'.\+,66-
        _ygh.Xb1Z&j)b3^4Q8^r+l"V)%f+"|(:6ZJ+r7
W-[-jW&z{Z0-.*',0"gxBX^ukZ
[";a
Gh('6hr"jC5(&&WqJ.Xm6v{"^r      ?v      
{)dJ"<(:6n2)^2O>{o+"1)Z:Z&jWzf"G'5<-`MJ))k22W&!|(9YbkhkbZ.r"6+y)iz;(+C5(&&W)f,yi
[,j[.&+5Yl
jeyJ&

Does it work for anyone else?

fkeshani commented 4 years ago

i have same issue @mikemaccana

ghost commented 4 years ago

based on the encoding of your email, you may need to change following line:

var html = (Buffer.from(all.body, 'base64').toString('ascii'));

to use utf8 or something else.