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.
Code: Copy
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
 
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
Please try the following code (not tested):
Code: Copy
Dim i As Intent
i = ei.GetIntent
i.SetComponent("com.google.android.gm", "com.google.android.gm.ConversationListActivity")
StartActivity(i)

Note that the new Net library allows you to send emails with attachments directly from your application using any mail server.
 
Upvote 0
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!

Code: Copy
ei.Attachments.Initialize
 
Upvote 0
Back
Top