iOS Question [SOLVED] B4I - EMAIL ACCOUNT

Biswajit

Active Member
Licensed User
Longtime User
 
Upvote 0

Anton Solans Argemí

Active Member
Licensed User
First of all thank you very much for your solution, that is what I wanted but now I have a problem:
Once I push "Send" the email send properly but the email screen doesn't disapear and the focus doesn't return to my APP.

I send the code I am using:

B4X:
'Code module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
    Public App As Application
    Private Page1 As Page
    Private hd As HUD
    Private mailc As MailComposer
    Private smsc As MessageComposer
    Private lsasunto,lsfitcsv As String
    Private lfiles As List
End Sub

Sub show (psfitcsv As String)
    
    If Page1.IsInitialized=False Then 
        Page1.Initialize("Page1")
    End If
    Main.NavControl.ShowPage(Page1)
            
    memail.preparaemail
    
    SendMail
End Sub


Private Sub SendMail

    lsfitcsv="Fichero.csv"    

    'always dim and initialize the MailComposer before you use it
    Dim mailc As MailComposer
    mailc.Initialize("mailc")
    mailc.SetSubject("Subject EMail")
    'mailc.SetBody("Body EMail", False)
    ' Adjutnar fichero csv
    mailc.AddAttachment(Main.gsdircsv, lsfitcsv,"csv")
    mailc.Show(Page_memailnc)
End Sub

Sub Mailc_Complete (Result As Int)
    Dim lssentsql As String
    
    If Result = mailc.RESULT_SENT Then
        'hd.ToastMessageShow("EMail enviado correctamente", True)
        Msgbox("EMail enviado correctamente","Atención")
        Finalizar(True)
    Else
        'hd.ToastMessageShow("Error al enviar EMail", True)
        Msgbox2("Msg","EMail no enviado. Desea marcar los registros como enviados?","Atención",Array("Si","No"))
        Wait For Msg_Click (ButtonText As String)
        If ButtonText="Si" Then
            Finalizar(True)
        Else
            Finalizar(False)
        End If
    End If
End Sub

Sub Finalizar(Traspasar As Boolean)

    
    If Traspasar=True Then
        Main.sql1.ExecNonQuery("UPDATE xxxxx")
    End If
    
    Main.NavControl.RemoveCurrentPage
    mtraspas.show2    
End Sub
 
Upvote 0
Top