iOS Question [B4X] [B4XPages] B4i how to send mail

imbault

Well-Known Member
Licensed User
Longtime User
Hi everyone,

Using this code
B4X:
Private Sub SendMail
   'always dim and initialize the MailComposer before you use it
   Dim mailc As MailComposer
   mailc.Initialize("mailc")
   mailc.SetToRecipients(Array("hello@example.com", "world@example.com"))
   mailc.SetSubject("This is the subject")
   mailc.SetBody("This is the <b>body</b>.", True)
   'create a file and add it as an attachment
   File.WriteString(File.DirTemp, "1.txt", "hello world")
   mailc.AddAttachment(File.DirTemp, "1.txt", "text/plain")
'''''''''''''
  'WHAT to put instead of Page1, B4XPages.MainPage.root ?
''''''''''''''''''
    mailc.Show(B4XPages.MainPage.Root)

End Sub

Sub Mailc_Complete (Result As Int)
End Sub

Many Thanks

Patrick
 
Top