GMAIL REST API - sending email with attachments
Application Type
Traditional Web

Hi everyone,

    I'm trying to use the gmail api, currently i was able to consume the method for sending an email without an attachment, but when it comes to attaching a file i couldn't make it work, i cannot consume it, i'm trying to use the upload type multipart, but i always end up having an error of "Malformed multipart body".

here's the request i am sending:


Authorization: Bearer + AccessToken

Content-Type : multipart/related; boundary=foo_bar_baz


Content-Type: application/json; charset=utf-8

Content-Disposition: form-data; name="metadata"



Content-Type: image/png

Content-Transfer-Encoding: BASE64

Content-Description: Picture B

Content-Disposition: ATTACHMENT

[base64-encoded image] - i will not attached it here since it's too long.


Anybody who had a previous experience in using the gmail api? any suggestions, i was a bit stuck up with this. any suggestions will do.




You might want to check the multipart/form-data Forge component. It can produce correct output.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.