Email help with attachment

rfhall50

Member
Licensed User
Longtime User
Background
My app has basic information about our retired residents: name, phone, apt #, and a picture. All working great - thanks to y'alls help. Many of our residents need "extra" help. My objective is to be able to email the picture off of my phone, to local police when a resident goes missing.

Progress
I have implemented the following code when the SendPic button is pressed on the view.
B4X:
Dim ei As Email
ei.To.Add("[email protected]")
ei.Body = "BOLO for " & ResName.Text
ei.Subject = "See attached picture."
ei.Attachments.Add(File.Combine(File.DirRootExternal, "MarySmith.jpg"))
StartActivity(ei.GetIntent)

When the button is pressed I get the following results:

If I CHOOSE GMAIL AS THE MAIL SERVER .... All supplied information is pre-filled, including the attachment. I do receive the email, but there is no attachment.

IF I CHOOSE VERIZON AS THE MAIL SERVER .... No information is prefilled, but I can add all the information, as well as the attachment, and I receive everything.

What can I do to get pre-filled information, as well as the attachment ??? Most of the email information in the help files seems to be about 6 months old - hoping there is new help available.

Thank You.
Bob
 

JDarter

Member
Licensed User
Longtime User
Erel,

Rather than using the "GetIntent" method which brings up a list of possible activities, is there a way to specify the exact intent of the activity (ie gmail)?

- Jeff
 
Upvote 0

Jim Brown

Active Member
Licensed User
Longtime User
I just wanted to share my experience here for this particular problem:

All supplied information is pre-filled, including the attachment. I do receive the email, but there is no attachment
I was getting the same issue. Attachments were shown in the email list but the final email received contained no attachments.

The solution turned out to be simple. You need to initialize the attachments list first. This fixes things for me. I can email photos from my app now!

B4X:
ei.Attachments.Initialize
 
Upvote 0
Top