login about faq

I am trying to get all emails from my hotmail account. There are about 27744 mails in Inbox. I am trying to get all emails through POP3.

I am capturing 10 mails at a time. I am following this tutorial: http://www.example-code.com/vbdotnet/pop3_readLargeMailbox.asp

Now after getting 2400 mails it is showing me an error.

No Socket exists for Sending (2b)

How to resolve this problem? I am trying for a long time without any success.

asked Aug 13 '12 at 11:31

chilkat's gravatar image

chilkat ♦♦
11.8k316358421


The "No socket exists for sending" error message means one of the following:

  1. A connection was never made to the server (SMTP, POP3, IMAP, FTP, etc.) and therefore the client-side has no valid connected socket.
  2. At some prior point, a Chilkat method call resulted in the loss of the connection, but the application did not check the status return of the method call. The error needs to be handled at the point of failure. Once the connection is lost, the Chilkat object is in the disconnected state, and a subsequent method call (that requires a connection) will fail with a message in the LastErrorText saying "No socket exists for sending".
link

answered Aug 13 '12 at 11:35

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

I think in my case the option 2 is the cause. The connection is somehow lost. Can you guide me how to check connection and if lost then reconnect. Here is the code i am using:

    Dim mailman As New Chilkat.MailMan()

'  Any string argument automatically begins the 30-day trial.
Dim success As Boolean
success = mailman.UnlockComponent("My-Registered-Unlock-Code")
If (success <> true) Then
    MsgBox("Component unlock failed")
    Exit Sub
End If

'  Set the POP3 server's hostname
mailman.MailHost = "mail.chilkatsoft.com"

'  Set the POP3 login/password.
mailman.PopUsername = "myLogin"
mailman.PopPassword = "myPassword"

'  First, get the list of UIDLs for all emails in the mailbox.
Dim sa As Chilkat.StringArray
sa = mailman.GetUidls()
Dim i As Long
Dim numEmails As Long
numEmails = sa.Count

'  Download the emails in chunks of 10 emails each.
Dim chunkBeginIdx As Long
chunkBeginIdx = 0
Dim chunkEndIdx As Long
chunkEndIdx = 9
If (chunkEndIdx >= numEmails) Then
    chunkEndIdx = numEmails - 1
End If

Dim saChunk As New Chilkat.StringArray()
While (chunkEndIdx < (numEmails - 1))

    '  Build a chunk of 10 UIDLs.
    saChunk.Clear()
    For i = chunkBeginIdx To chunkEndIdx
        saChunk.Append(sa.GetString(i))
    Next

    '  Display the UIDLs in this chunk...
    Dim chunkStr As String
    chunkStr = saChunk.SaveToText()
    TextBox1.Text = TextBox1.Text & chunkStr & vbCrLf
    TextBox1.Text = TextBox1.Text & "----" & vbCrLf & vbCrLf

    '  Download this chunk of email from the POP3 server.
    Dim bundle As Chilkat.EmailBundle
    bundle = mailman.FetchMultiple(saChunk)
    If (bundle Is Nothing ) Then
        MsgBox(mailman.LastErrorText)
        Exit Sub
    End If

    '  Process the bundle...
    '  (your application's processing code goes here...)

    '  Get the next chunk...
    chunkBeginIdx += 10
    If (chunkBeginIdx >= numEmails) Then
        Exit For
    End If

    chunkEndIdx += 10
    If (chunkEndIdx >= numEmails) Then
        chunkEndIdx = numEmails - 1
    End If
End While
link

answered Aug 13 '12 at 14:00

Shaoun1000's gravatar image

Shaoun1000
1556

I updated the online example. The call to mailman.GetUidls should be checked, like this:

'  First, get the list of UIDLs for all emails in the mailbox.
Dim sa As Chilkat.StringArray
sa = mailman.GetUidls()
If (sa Is Nothing ) Then
    TextBox1.Text = TextBox1.Text & mailman.LastErrorText & vbCrLf
    Exit Sub
End If

link

answered Aug 14 '12 at 09:49

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks for the fix. But i can not understand. The problem is while extracting mails the connection is somehow lost. How we can check whether an active connection is working or not? And if not working then how to reconnect and resume the job. And it should be in While.. End While loop. Please confirm.

Thanks.

link

answered Aug 14 '12 at 18:24

Shaoun1000's gravatar image

Shaoun1000
1556

Hi, Any update?

link

answered Aug 15 '12 at 15:45

Shaoun1000's gravatar image

Shaoun1000
1556

Use the DebugLogFilePath property to create a log file that contains the LastErrorText's of every Chilkat method call (for the imap object instance). Then examine the log file to find out where the connection becomes lost. You should see the connection become lost, and then each subsequent LastErrorText will indicate that "no socket exists".

Also, make sure you are using the very latest version (v9.3.2).

Finally, whenever posting a LastErrorText, make sure to include the entire amount, including the information at the beginning.

link

answered Aug 15 '12 at 19:04

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×60
×60
×1
×1

Asked: Aug 13 '12 at 11:31

Seen: 3,517 times

Last updated: Aug 15 '12 at 19:04

powered by OSQA