I'm using class GmailApp of google apps script to get body of mail and show it in html.
Body get ok but img of mail error:
ERR_UNKNOWN_URL_SCHEME.
Is there any way to retrieve the entire message body, including the image?
Code GS:
function GetBodyMail(){
var thread = GmailApp.getThreadById("16cfd66654bb9593") ;
var mgs = thread.getMessages();
var mgsBody = mgs[0].getBody();
return mgsBody;
}



getAttachments()method ofGmailMessageand setting theincludeInlineImagesparameter totrue? - I hope this is helpful to youmgsBodyto? How are you trying to display the email content that you are obtaining from the function you posted? I'm not able to reproduce the error simply from attaching an in-line image to a mail and using thegetBody()method like in your example. - I hope this is helpful to yougetBody()method containscid:[email protected], which isn't a valid source for an image in the<img>tag. The images in a Gmail message aren't stored with public facing URLs so you would have to get the attachments individually by calling thegetAttachments()method and then inserting the images into the HTML content via script before returningmgsBodyat the end of the function. - I hope this is helpful to yougetAttachments()method to extract the images from the message. - I hope this is helpful to you