E-Mail

Bill Norris

Active Member
Licensed User
Longtime User
Would like user to be able to send the contents of a text box to themselves as either the body of an email or as an attachment. Basically, touch an "Email" button which will bring up activity with keyboard and a text box to put in their email address. I don't need help with that part, just the code for the email functionality. Can someone point me in the right direction to get started?
 

NJDude

Expert
Licensed User
Longtime User
You can do something like this:
B4X:
    Dim Message As Intent
    Dim Subject As String
    Dim Body As String

    Uri = "mailto:?subject=" & Subject & "&body=" & Body

    Message.Initialize(Message.ACTION_VIEW, Uri)

    StartActivity(Message)
 
Upvote 0

hdtvirl

Active Member
Licensed User
Longtime User
send emails through an SMTP server.

Also this method using the NET Library. Make sure you Tick the NET Library and not the network Library.

see here for full details of usage.

Basic4android - Net


Regards


BOB
 
Upvote 0
Top