- '###########################################################################"
- Label8.Caption = "Connection en cours ..."
- Dim tmp As String
- Set evt = ws
- If evt.State = sckConnected Then Exit Sub
- nbrecept = 0
- ws.connect LireINI("email", "pop"), 110
- While ws.State <> sckConnected
- DoEvents
- Wend
- 'Attente du message de bienvenue
- nextSend = False
- While nextSend = False
- DoEvents
- Wend
-
- nextSend = False
- ws.SendData "USER " & LireINI("email", "utilisateur") & vbCrLf
- While nextSend = False
- DoEvents
- Wend
-
- nextSend = False
- ws.SendData "PASS " & UncryptMsg(LireINI("email", "mdp")) & vbCrLf
- While nextSend = False
- DoEvents
- Wend
-
-
-
- If InStr(1, AnSwEr, "OK") > 0 Then
- Label8.Caption = "Vous êtes connecté"
- Else
- Label8.Caption = "Login/mot de passe incorrect"
- End If
-
- nextSend = False
- ws.SendData "STAT" & vbCrLf
- While nextSend = False
- DoEvents
- Wend
- Label8.Caption = Mid(AnSwEr, 4, 3) & " emails"
- If Mid(AnSwEr, 4, 3) = 0 Then
- Exit Sub
- End If
- 'recuperation des titre des mails
- Dim nb As Integer
- nb = Mid(AnSwEr, 4, 3)
- nextSend = False
- ws.SendData "LIST" & vbCrLf
- While nextSend = False
- DoEvents
- Wend
-
- Dim i As Integer
- i = 1
- While i < nb + 1
- nextSend = False
- ws.SendData "TOP " & i & " 0" & vbCrLf
- While nextSend = False
- DoEvents
- Wend
- Text1.Text = AnSwEr
- Position& = Text1.Find("SUBJECT", , , rtfWholeWord)
- Dim j As Integer
- j = 0
- While Mid(AnSwEr, Position + 9 + j, 2) <> vbNewLine
- DoEvents
- j = j + 1
- Wend
- '---------------------------------------
-
- '---------------------------------------
- lstMessage.AddItem (Mid(AnSwEr, Position + 9, j))
- DoEvents
- i = i + 1
- Wend
-
- '###########################################################################"
- lstMessage.Text = lstMessage.List(0)
'###########################################################################"
Label8.Caption = "Connection en cours ..."
Dim tmp As String
Set evt = ws
If evt.State = sckConnected Then Exit Sub
nbrecept = 0
ws.connect LireINI("email", "pop"), 110
While ws.State <> sckConnected
DoEvents
Wend
'Attente du message de bienvenue
nextSend = False
While nextSend = False
DoEvents
Wend
nextSend = False
ws.SendData "USER " & LireINI("email", "utilisateur") & vbCrLf
While nextSend = False
DoEvents
Wend
nextSend = False
ws.SendData "PASS " & UncryptMsg(LireINI("email", "mdp")) & vbCrLf
While nextSend = False
DoEvents
Wend
If InStr(1, AnSwEr, "OK") > 0 Then
Label8.Caption = "Vous êtes connecté"
Else
Label8.Caption = "Login/mot de passe incorrect"
End If
nextSend = False
ws.SendData "STAT" & vbCrLf
While nextSend = False
DoEvents
Wend
Label8.Caption = Mid(AnSwEr, 4, 3) & " emails"
If Mid(AnSwEr, 4, 3) = 0 Then
Exit Sub
End If
'recuperation des titre des mails
Dim nb As Integer
nb = Mid(AnSwEr, 4, 3)
nextSend = False
ws.SendData "LIST" & vbCrLf
While nextSend = False
DoEvents
Wend
Dim i As Integer
i = 1
While i < nb + 1
nextSend = False
ws.SendData "TOP " & i & " 0" & vbCrLf
While nextSend = False
DoEvents
Wend
Text1.Text = AnSwEr
Position& = Text1.Find("SUBJECT", , , rtfWholeWord)
Dim j As Integer
j = 0
While Mid(AnSwEr, Position + 9 + j, 2) <> vbNewLine
DoEvents
j = j + 1
Wend
'---------------------------------------
'---------------------------------------
lstMessage.AddItem (Mid(AnSwEr, Position + 9, j))
DoEvents
i = i + 1
Wend
'###########################################################################"
lstMessage.Text = lstMessage.List(0)