I am using the program code of "Android Tutorial [B4X] Sending emails with Gmail REST API" it works almost perfectly. According to the description you can send several attachments, this does not work unfortunately. Only the most recently added attachment will be sent. What am I doing wrong?
B4X:
Sub Button1_Click
Dim msg As MailCreator
msg.Initialize
msg.HtmlBody = True
msg.ToList.Add("******@gmx.de")
msg.Subject = "test"
msg.Body = $"First line<br/>second line"$
'add attachment
Dim fd As MultipartFileData
fd.ContentType = "image/jpeg"
fd.Dir = File.DirAssets
fd.FileName = "android.png"
msg.Attachments.Add(fd)
fd.ContentType = "image/jpeg"
fd.Dir = File.DirRootExternal&"/MtoM"
fd.FileName = "1.jpg"
fd.ContentType = "image/jpeg"
fd.Dir = File.DirRootExternal&"/MtoM"
fd.FileName = "2.jpg"
msg.Attachments.Add(fd)
Send(msg)
End Sub