Re: Doesn't seem to be connecting! - WeOnlyDo Discussion board

Re: Doesn't seem to be connecting! (General questions)

by nightwalker83, Friday, August 27, 2010, 11:41 (5204 days ago) @ nightwalker83

Hi,

I was able to use pop successfully the past couple of weeks! It has been since about the 18th of this month that I haven't been able to.
I have tested the examples that come with the pop component and they seem to only working half the time. I will send you my visual basic 6 project when I get home tonight. Although, comparing the code I used for pop to that provided in the examples I can't see anything that is different.

I was able to fix the problem using the following:

Dim MsgCount
Dim WithEvents Pop3 As wodPop3Com
Private Sub Command1_Click()
Select Case cboHost.Text
Case Other
With Pop3
.HostName =
.login =
.Password =
'.Port = 110
.Connect
End With
Case Gmail
With Pop3
.HostName = pop.gmail.com
.login =
.Password =
.Port = 995
.Connect
End With
End Select
End Sub

Private Sub Form_Load()
Set Pop3 = New wodPop3Com
End Sub

Private Sub Pop3_Connected()
Debug.Print Connected
Form1.Caption = Form1.Caption & & You have & MsgCount & new messages!
Pop3.Messages.GetAll
End Sub

Private Sub Pop3_Disconnected(ByVal ErrorCode As Long, ByVal ErrorText As String)
If ErrorCode <> 0 Then
Debug.Print ErrorText
End If
End Sub


Private Sub Pop3_StateChange(ByVal OldState As WODPOP3COMLib.StatesEnum)
Me.Caption = Pop3.StateText
Debug.Print Pop3.StateText
End Sub
Private Sub Pop3_Done(ByVal ErrorCode As Long, ByVal ErrorText As String, ByVal HeadersOnly As Boolean)
Dim i As Integer
If LstNewMail.ListCount = 0 Then
For i = 0 To Pop3.Messages.Count - 1
LstNewMail.AddItem Pop3.Messages(i).FromName & ( & Pop3.Messages(i).Subject & )
Next i
End If
End Sub


Complete thread: