Press on the image to return to the main documentation page.
Net
The Net library implements the following protocols: FTP, SMTP and POP3. Both regular connections and secured connections are supported. The implementations are based on Apache Commons Net. All the methods in this library are non-blocking. This library replaces the FTP library.
DownloadCompleted (ServerPath As String, Success As Boolean) DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long) UploadCompleted (ServerPath As String, Success As Boolean) UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long) DeleteCompleted (ServerPath As String, Success As Boolean) CommandCompleted (Command As String, Success As Boolean, ReplyCode As Int, ReplyString As String) ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
POP3 object allows you to connect to mail servers and read the mail messages. This object returns the raw string of each message, including the headers. Parsing the raw string is currently out of the scope of this library. The connection is established when it is first required. ListCompleted event passes a parameter named Messages. This is a map with the messages IDs as keys and the messages sizes as values. DownloadCompleted event passes the message raw string in the Message parameter. Example: SubProcess_Globals DimPOPAsPOP3 EndSub SubGlobals
SubPOP_ListCompleted (SuccessAsBoolean, MessagesAsMap)
Log("List: " & Success)
IfSuccessThen Fori = 0ToMessages.Size - 1 Pop.DownloadMessage(Messages.GetKeyAt(i), True) 'Download all messages and delete them Next Else Log(LastException.Message)
EndIf POP.Close'The connection will be closed after all messages are downloaded EndSub SubPOP_DownloadCompleted (SuccessAsBoolean, MessageIdAsInt, MessageAsString)
Log("Download: " & Success & ", " & MessageId)
IfSuccessThen Log(Message)
Log(Message.Length)
Log(MessageId)
Else Log(LastException.Message)
EndIf EndSub
Permissions:
android.permission.INTERNET
Events:
ListCompleted (Success As Boolean, Messages As Map) DownloadCompleted (Success As Boolean, MessageId As Int, Message As String) StatusCompleted (Success As Boolean, NumberOfMessages As Int, TotalSize As Int)
SMTP object allows you to send emails with no user intervention and without relying on the device installed mail clients. Both text messages and Html messages are supported as well as file attachments. There are two encryption modes supported: UseSSL and StartTLSMode. UseSSL means that the connection will be based on a SSL connection right from the start. StartTLSMode means that the connection will only be upgraded to SSL after the client send the STARTTLS command. Most SMTP servers support this mode. Gmail for example supports both modes. UseSSL on port 465 and StartTLSMode on port 587.