Android Question Failed to sent file attachment from DirInternal

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I tried to sent email with attachment with these codes
B4X:
Sub Button1_Click
    Dim ei As Email
    ei.To.Add("abc@gmail.com")
    ei.Body = "File"
    ei.Subject = "File with attachment"
    ei.Attachments.Add(File.Combine(File.DirInternal, "GoodCat.csv"))
    StartActivity(ei.GetIntent)
End Sub

Email sent, but no attachment.
If I changed the code from :
ei.Attachments.Add(File.Combine(File.DirInternal, "GoodCat.csv"))

to : ei.Attachments.Add(File.Combine(File.DirRootExternal, "GoodCat.csv"))

Email and attachment sent ok.

Is this normal? Can't send attachment from DirInternal?

Thanks in advance.
 

incendio

Well-Known Member
Licensed User
Longtime User
Ok, I got it. My app call gmail to send email, so gmail can't access DirInternal.

Thanks for your confirmation.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…