B4J Question question on Building a mini "Email based server"

juvanum

Active Member
Licensed User
Longtime User
Hello,
I'm trying the erel' solution " Building a mini Email based server".

1) If i use a gmail account ([email protected]) all run properly: the messages are downloaded only once and the messages are not deleted


2) If I use another account not google ([email protected]), the messages are downloaded every time :(

3) if I use microsoft outlook on the same account ([email protected]), the messages are downloaded only once and the messages are not deleted

Why (step 2) the same messages are downloaded always?? :mad:

thank you
 

juvanum

Active Member
Licensed User
Longtime User
I don't remember the exact code however you should download the messages and set the last parameter in POP.DownloadMessage (Delete) to True.
Thanks Erel but I need them not to be deleted.
However I would like only the new messages to be downloaded.
the gogle account does it, other providers do not.

B4X:
Sub pop_ListCompleted (Success As Boolean, Messages As Map)
    
    Log("list completed")   
    If Success Then
        If Messages.Size > 0 Then
            LogMessage("Found messages: " & Messages.Size)
             For Each id As Int In Messages.Keys
                pop.DownloadMessage(id, deleteMsg) 'if true message will be deleted from the server
                
            Next
            lastMsgId = id
        Else
            Log("No messages.")
        End If
    Else
       LogMessage("Error: " & LastException)
   
    End If   
    pop.Close 'this will close the connection after the messages were downloaded.
 
End Sub
 
Upvote 0
Top