Android Question Send email from internal

Fabri

Member
Licensed User
Hello,
by click is possible send email from internal app:


Dim i As Intent
i.Initialize(i.ACTION_VIEW, "mailto: helloman@gmail.com")
StartActivity(i)

but is it possible also fill in the object with "Infomation about app" for example?
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
Try this:
B4X:
Sub mnuEmail_Click
    Private emlMsg As Email

    emlMsg.To.Add("someone@somewhere.com")
    emlMsg.Subject = "Something"
    emlMsg.Body = "A whole bunch of stuff"
    StartActivity(emlMsg.GetIntent)

End Sub

- Colin
 
Upvote 0

Smee

Well-Known Member
Licensed User
Longtime User
The code I use to send emails is

B4X:
Receiver="email address here"
SMTP1.Initialize(server, port, emailname, Password, "SMTP1")
SMTP1.UseSSL=True
SMTP1.AuthMethod=SMTP1.AUTH_LOGIN
SMTP1.To.Add(Receiver)
SMTP1.Subject = Subject
'SMTP1.Body = Body
SMTP1.BCC.Add("another email")
'        SMTP1.CC.Add (dbCursor.GetString("Email"))
'SMTP1.AddAttachment(Main.csvDirectory,Main.csvFile)
SMTP1.AddAttachment(File.DirInternal & "/extfiles/","filename")
SMTP1.AddAttachment(File.DirInternal & "/extfiles/","filename2")
SMTP1.AddAttachment    (File.DirInternal, "Any Attachment")

SMTP1.Subject = gb.GetDeviceId

SMTP1.Send
 
Upvote 0

Filippo Carboni

Member
Licensed User
Longtime User
Try this:
B4X:
Sub mnuEmail_Click
    Private emlMsg As Email

    emlMsg.To.Add("someone@somewhere.com")
    emlMsg.Subject = "Something"
    emlMsg.Body = "A whole bunch of stuff"
    StartActivity(emlMsg.GetIntent)

End Sub

- Colin

I hope this isn't necroposting anyway...
@Computersmith64
What library did you use for this code? Because I searched it on this fantastic forum but I didn't find it
 
Upvote 0
Top