I am trying to get an attachment from a mail in golang. The problem is in the base64 payload read from Gmail giving me the error
illegal base64 data at input byte 13
Here's my code (err handling omitted) ..
attach, _ := srv.Users.Messages.Attachments.Get(user, messageid, attachmentid).Do()
decoded, err := base64.StdEncoding.DecodeString(attach.Data)
This throws the mentioned error and if I look at the original message in GMail can see after the headers this:
begin 644 filename-of-the-attachment.extension
M'XL(`/Y;GU8``^S]R[(>R9&E"\[[*5)JVI*6;N9WS(_TD3/J0<U:>H`*;F9"...
Any help appreciated Thanks