Simple email question

wheretheidivides

Active Member
Licensed User
Longtime User
Email q&a. please add to phone tutorial

So I can email a file to myself. But how do you set the subject or body?
I tried:
Message.Subject.Add("Poker Dealer's Tip & Wage Tracker-Tips Database")
but it didn't work.
 
Last edited:

wheretheidivides

Active Member
Licensed User
Longtime User
Message.Subject = "This is the subject line text."
Message.Body = "This is the body text."
=====================

So I figured it out. Erel or whoever, could you add this to the email phone area for others to see?
Basic4android - Phone
under the section

Email
Using an Email object you can create an intent that holds a complete email message.
You can then launch the email application by calling StartActivity. Note that the email will not be sent automatically. The user will need to press on the send button.
Example:
Dim Message As Email
Message.To.Add("[email protected]")
Message.Attachments.Add(File.Combine(File.DirRootExternal, "SomeFile.txt"))
StartActivity(Message.GetIntent)
 
Upvote 0

murdoch1976

Member
Licensed User
Longtime User
Dim Message As Email
Message.To.Add("[email protected]")
Message.Attachments.Add(File.Combine(File.DirRootE xternal, "SomeFile.txt"))
StartActivity(Message.GetIntent)

This works perfectly. However, the line "StartActivity" launches a "Complete action using..." activity. I expected this to happen, as I have more than one email app installed that can deal with the intent. However, the list of apps I am presented with includes...

Bluetooth
Copy to Clipboard
Google Drive
Facebook
Google
Google+
LinkedIn
Messaging
WiFi Direct

... why would all these other apps appear? I would not have thought "Bluetooth" would cope with the email intent (in fact it does not, if I select it I get an error "Unable to open file for sharing"). If I select an email app the intent works perfectly.

Is there any way to prevent all these other apps from displaying?

Many thanks,

Murdoch
 
Upvote 0

JOTHA

Well-Known Member
Licensed User
Longtime User
Note that the email will not be sent automatically. The user will need to press on the send button
... and how can it be sent automatically?
 
Upvote 0

JOTHA

Well-Known Member
Licensed User
Longtime User
Thank you Erel!
I'll try it ... and send my feedback. ;)
 
Upvote 0
Top