Hi Guys,
I have been coding a small program to login to pop servers using IMAP, my very basic code is:
I have added the reference to the mail.dll from an example here: Windows Download emails using IMAP sample in C#, VB.NET
The module file:
The bit i'm having trouble with is passing my form variables:
strServer.text
strUser.text
strPass.text
to the module file to use:
imap.Connect(strServer.text) ' or ConnectSSL for SSL
imap.Login(strUser.text, strPass.text)
I have spent to long away from coding, just getting the feel for it again
thanks for any help guys
Graham
I have been coding a small program to login to pop servers using IMAP, my very basic code is:
VB.NET:
Imports System.IO
Imports System.Net.Sockets
Imports System.Text
Imports System.Net.Security
Imports System.Net
Imports Limilabs.Mail
Imports Limilabs.Client.IMAP
Public Class formMain
Private Sub mainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles getMailButton.Click
'// On Get Emails button, do some validation of the fields before processing...
End Sub
End Class
I have added the reference to the mail.dll from an example here: Windows Download emails using IMAP sample in C#, VB.NET
The module file:
VB.NET:
Imports Limilabs.Mail
Imports Limilabs.Client.IMAP
Public Module Module1
Public Sub Main(ByVal args As String())
Using imap As New Imap()
imap.Connect("pop.aol.com") ' or ConnectSSL for SSL
imap.Login("user", "password")
imap.SelectInbox()
Dim uids As List(Of Long) = imap.Search(Flag.Unseen)
For Each uid As Long In uids
Dim eml As String = imap.GetMessageByUID(uid)
Dim email As IMail = New MailBuilder() _
.CreateFromEml(eml)
Console.WriteLine(email.Subject)
Console.WriteLine(email.Text)
Next
imap.Close()
End Using
End Sub
End Module
The bit i'm having trouble with is passing my form variables:
strServer.text
strUser.text
strPass.text
to the module file to use:
imap.Connect(strServer.text) ' or ConnectSSL for SSL
imap.Login(strUser.text, strPass.text)
I have spent to long away from coding, just getting the feel for it again
thanks for any help guys
Graham