open email and read text

fifiddu70

Well-Known Member
Licensed User
Longtime User
Hello everyone, I would like to make an application for tablet able to make me appear automatically e-mails arriving via the internet on the tablet, I thought of a texbox to see the e-mail and a button to clear 'email received, I think the program should do a refresh to display the new e-mail, someone can tell me how to start?
 

fifiddu70

Well-Known Member
Licensed User
Longtime User
I've seen this example, but I can not see the incoming message.
insert lamia email, my password,
Use txtleggi.text for reading the message,
and when the email arrives the phone makes the sound notification but nothing on the textbox svisualizzo
what is wrong?
I'll post my code

B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Dim POP As POP3
End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   
   
   Dim txtleggi As EditText
   Dim btnpulisci As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("comandemail")
   If FirstTime Then
        POP.Initialize("pop.gmail.com", 995, "fifiddu80@gmail.com", "mypass", "pop")
        POP.UseSSL = True 'Gmail requires SSL.
    End If
   POP.ListMessages
End Sub
Sub POP_ListCompleted (Success As Boolean, Messages As Map)
    Log("List: " & Success)
    If Success Then 
        For i = 0 To Messages.Size - 1
            POP.DownloadMessage(Messages.GetKeyAt(i), True) 'Download all messages and delete them
         
        Next
    Else 
        Log(LastException.Message)
    End If
    POP.Close 'The connection will be closed after all messages are downloaded
End Sub
Sub POP_DownloadCompleted (Success As Boolean, MessageId As Int, Message As String)
    Log("Download: " & Success & ", " & MessageId)
    If Success Then 
        Log(Message)
        Log(Message.Length)
        Log(MessageId)
      txtleggi.text = Message
    Else 
        Log(LastException.Message)
    End If
   
End Sub 

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub txtleggi_EnterPressed
   
End Sub
Sub btnpulisci_Click
   txtleggi.Text=""
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…