I have been working with SMTP and POP3 in a Visual Developer for Web 2012 project using Indy Sockets. The standard server protocols work great but I have run into a snag attempting to implement SSL. There are a number of SMTP & POP servers out there that require SSL, including Gmail and I would like to make it available in the project. However, I cannot seem to find any good documentation on SSL for Indy Sockets SMTP & POP3 objects. The only place I could find anything about SSL for Indy Sockets was listed on a reference from an Indy Sockets knowledge base article pointing to an item posted on Intellicom (http://www.intelicom.si/en/forum/list.php?f=3) but the link gives a Not Found error when followed.
I am looking for some documentation that could help with using SSL with Indy Sockets. If anyone knows where I can find documentation or some code examples I would greatly appreciate being pointed in the right direction. I have posted some code below that I am using to implement SSL for POP3, bit it does not seem to work when 'UseSSL' is set to true.
Dim xHost As String = Session.Item("POPServer") Dim xUsername As String = Session.Item("POPUser") Dim xPassword As String = Session.Item("POPPassword") Dim xPort As String = Session.Item("POPPort") Dim xSSL As Boolean = Session.Item("POPUseSSL") Dim xPOP3 As POP3 = New POP3 Dim xMsg As Message = New Message() xPOP3.Username = xUsername xPOP3.Password = xPassword xPOP3.Port = CType(xPort, Integer) If xSSL Then xPOP3.AuthType = POP3AuthenticationType.atSASL Try xPOP3.Connect(xHost) Dim xCount As Integer = xPOP3.CheckMessages() ReDim TheEmailMessages(xCount, msgCount) If xCount = 0 Then Exit Function Else For ACounter = 1 To xCount xPOP3.Retrieve(ACounter, xMsg) TheEmailMessages(ACounter, msgSubject) = xMsg.Subject.ToString TheEmailMessages(ACounter, msgFrom) = xMsg.From.Text TheEmailMessages(ACounter, msgTo) = xMsg.Recipients(0).Text TheEmailMessages(ACounter, msgBody) = xMsg.Body.Text TheEmailMessages(ACounter, msgMsgID) = xMsg.MsgId.ToString TheEmailMessages(ACounter, msgAddress) = xMsg.From.Address.ToString TheEmailMessages(ACounter, msgNumber) = Str(ACounter).Trim TheEmailMessages(ACounter, msgDate) = Indy.Sockets.Units.IdGlobalProtocols.DateTimeToInternetStr(xMsg.Date, False) Next End If Catch ex As Exception Debug.Print ex.Message End Try xPOP3.Disconnect()