Difference between revisions of "POP3SecureSocket"

From Xojo Documentation

 
Line 17: Line 17:
 
{{Event | name=RollbackSuccessful | description= RollbackSuccessful()
Executes in response to a call to RollbackServer and indicates that the state of the mailbox has been reset }}
 
{{Event | name=RollbackSuccessful | description= RollbackSuccessful()
Executes in response to a call to RollbackServer and indicates that the state of the mailbox has been reset }}
 
{{Event | name=ServerAvailable | description=ServerAvailable()
Executes when the mail server has replied to a call to CheckServerConnection and indicates that the mail server has replied to the call }}
 
{{Event | name=ServerAvailable | description=ServerAvailable()
Executes when the mail server has replied to a call to CheckServerConnection and indicates that the mail server has replied to the call }}
{{Event | name=ServerReplied | params=command as [[String]], data as [[String]] | description=ServerReplied(Command as String, Data as String)
Executes in response to a call to SendServerCommand and contains the mail server's response to the command passed }}
+
{{Event | name=ServerCommandReply | params=command as [[String]], data as [[String]] | description= ServerCommandReply(Command as String, Data as String)
Executes in response to a call to SendServerCommand and contains the mail server's response to the command passed }}
 
{{Event | name=ServerError | params=ErrorCode as [[Integer]],ErrorMessage as [[String]],  MessageID as [[Integer]] | description=ServerError(ErrorCode as Integer, ErrorMessage as String, MessageID as Integer)
Executes when a protocol-related error occurs.  }}
 
{{Event | name=ServerError | params=ErrorCode as [[Integer]],ErrorMessage as [[String]],  MessageID as [[Integer]] | description=ServerError(ErrorCode as Integer, ErrorMessage as String, MessageID as Integer)
Executes when a protocol-related error occurs.  }}
 
{{Event | name=TopLinesReceived | params=Index as [[Integer]],Data as [[EmailMessage]] | description=TopLinesReceived(Index as Integer,Data as EmailMessage)
Executes in response to a call to RetrieveLines.  }}
 
{{Event | name=TopLinesReceived | params=Index as [[Integer]],Data as [[EmailMessage]] | description=TopLinesReceived(Index as Integer,Data as EmailMessage)
Executes in response to a call to RetrieveLines.  }}

Latest revision as of 21:06, 11 May 2020

Class (inherits from SSLSocket)

Used to retrieve messages on a POP3 mail server using SSL or TLS encryption.

Events
ConnectionEstablished MessageReceived ServerAvailable
Disconnected MessagesCounted ServerCommandReply
ListReceived RollbackSuccessful ServerError
LoginSuccessful SendComplete TopLinesReceived
MessageDeleted SendProgress
Properties
Address Handle fa-lock-32.png SSLConnected fa-lock-32.png
BytesAvailable fa-lock-32.png IsConnected fa-lock-32.png SSLConnecting fa-lock-32.png
BytesLeftToSend fa-lock-32.png LocalAddress fa-lock-32.png SSLConnectionType
CertificateFile NetworkInterface SSLEnabled
CertificatePassword Password Username
CertificateRejectionFile Port
EncryptPassword RemoteAddress fa-lock-32.png


Methods
CheckServerConnection Lookahead RequestMessages
Close MessagesCounted RetrieveLinesAt
Connect Poll RetrieveMessageAt
Disconnect Purge RollbackServer
DisconnectFromServer ReadAll SendCommand
Listen RemoveMessageAt

Notes

The POP3SecureSocket class is identical to the POP3Socket class, except that it is derived from the SSLSocket class instead of the TCPSocket class. This enables you to send secure email by setting the Secure property of the SSLSocket class.

If you use a constructor of a subclass of POP3SecureSocket, you must call the Super class's constructor in your subclass's constructor. The subclass will not work unless this is done.

Sample Code

The following code in the MessageReceived event handler places the body of an email message in a TextArea.

Sub MessageReceived(ID As Integer, email As EmailMessage)
Var s As String
s = email.BodyHTML
If s = "" Then
s = email.BodyPlainText
End If
TextArea1.Value = s
End Sub

See Also

EmailMessage, HTTPSocket, POP3Socket, SMTPSecureSocket, SMTPSocket, SSLSocket, SocketCore, TCPSocket classes.]