Hello, the following code demonstrates how to achieve this:
' connect to a POP3 server and authenticate
Dim client = New Pop3()
client.Connect(serverName, serverPort, sslMode)
client.Login(userName, password)
' download a message as an instance of MailMessage
Dim message As MailMessage = client.GetMailMessage(messageSequenceNumber)
' if the message is signed, check signature validity and display
' a message box if not valid
If message.IsSigned Then
Dim validity As MailSignatureValidity = message.ValidateSignature()
If Not validity.Valid Then
System.Windows.Forms.MessageBox.Show("Message signature is not valid.")
End If
End If
Note: In an actual application, don't forget to disconnect the 'client' instance when no longer needed, otherwise the session would remain active until the instance of Pop3 is claimed by the garbage collector.
For a sample code that downloads more than one specific message, please see our Pop3Downloader sample code, which comes with Rebex Secure Mail packages.