+1 vote

Hi, I'm using the following vb.Net code in solution with Limilabs.Mail trial version but it fails on the second line starting with "imap.connect"

I checked my Gmail settings as well my Antivirus and Firewall settings and they look fine but I still get the following error message: Tried to read a line. No data received. Please make sure that antivirus and firewall software are disabled or configured correctly.

Using imap As New Limilabs.Client.IMAP.Imap()
    **imap.Connect("imap.gmail.com", 993)**
    imap.UseBestLogin("user@gmail.com", "password")
    imap.SelectInbox()

    Dim uids As List(Of Long) = 
        imap.Search(Limilabs.Client.IMAP.Flag.All)

        For Each uid As Long In uids
            Dim email As IMail = New MailBuilder()
                .CreateFromEml(imap.GetMessageByUID(uid))

            For Each mime As MimeData In email.Attachments
                mime.Save("C:\Users\User\Desktop\" + mime.SafeFileName)
            Next
     Next
     imap.Close()
End Using
by
reopened by

1 Answer

0 votes
 
Best answer

Please use SSL - ConnectSSL("imap.gmail.com") - when connecting to Gmail:

Using imap As New Limilabs.Client.IMAP.Imap()
    imap.ConnectSSL("imap.gmail.com")

    imap.UseBestLogin("user@gmail.com", "password")
    imap.SelectInbox()

    ' ...

    imap.Close()
End Using

You don't need to specify port, almost all email servers use default ones.

by (300k points)
...