1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
| PUBLIC SUB ReadMail(i AS INTEGER, n AS INTEGER)
DIM sDecode AS STRING DIM sFileName AS STRING DIM sPartHtml AS STRING DIM sImage AS STRING DIM sContentType AS STRING DIM p AS INTEGER DIM iCode AS INTEGER
monHtml = "" monImage = "" monIndice = -1 maPiece.Clear
Module1.serveurPop(i) TRY Module1.POP.Open
IF NOT ERROR THEN IF Module1.POP.Count > 0 THEN WITH Module1.POP[n] maString = maString & ("De : ") & .Message.Sender & gb.CrLf ' de maString = maString & ("Objet : ") & .Message.Subject & gb.CrLf ' objet maString = maString & ("À : " & .Message.To & gb.CrLf ' À maString = maString & "UniqueID : " & .UniqueID & gb.CrLf ' UniqueID maString = maString & ("Date : ") & .Message.Headers["Date"] & gb.CrLf maString = maString & ("Réponse à : "& .Message.ReplyTo & gb.CrLf ' ReplyTo maString = maString & ("Taille : ") & .Size & gb.CrLf ' taille maString = maString & ("Type de Contenu : ") & .Message.Part.ContentType IF .Message.Part.Count = 0 THEN sContentType = .Message.Body.ContentType iCode = .Message.Body.ContentEncoding maString2 = maString2 & "\n - - - - - - - - - - - - - - - " & " ContentType = " & sContentType & " - Part0 -" & " Code = " & iCode & "- - - - - - - - - - - -- \n " & .Message.Body.Data IF .Message.Body.ContentType LIKE "*html*" THEN sPartHtml = "Partie Html.html" sDecode = .Message.Body.Data File.Save(Module1.dirTemp &/ sPartHtml, sDecode) monHtml = File.Name(Module1.dirTemp &/ sPartHtml) ENDIF ELSE IF .Message.Body.Count > 0 THEN FOR p = 0 TO .Message.Body.Count - 1 sContentType = .Message.Body[p].ContentType iCode = .Message.Body[p].ContentEncoding maString2 = maString2 & "\n - - - - - - - - - - " & " ContentType = " & sContentType & " - Body - " & p & " - " & " Code = " & iCode & " - - - - - - - - - \n " & .Message.Body[p].Data IF .Message.Body[p].ContentType LIKE "*html*" THEN sPartHtml = "Partie Html.html" sDecode = .Message.Body[p].Data File.Save(Module1.dirTemp &/ sPartHtml, sDecode) monHtml = File.Name(Module1.dirTemp &/ sPartHtml) ENDIF NEXT ELSE IF .Message.Part.Count > 0 THEN FOR p = 0 TO .Message.Part.Count - 1 sContentType = .Message.Part[p].ContentType IF sContentType LIKE "*multipart/signed*" THEN iCode = .Message.Part[.Message.Part.Count - 1].ContentEncoding ELSE iCode = .Message.Part[p].ContentEncoding ENDIF maString2 = maString2 & "\n - - - - - - - " & " ContentType = " & sContentType & " - Part - " & p & " - " & " Code = " & iCode & "- - - - - - - - - - - \n " & .Message.Part[p].Data IF .Message.Part[p].ContentType LIKE "*html*" THEN sPartHtml = "Partie Html.html" sDecode = .Message.Part[p].Data File.Save(Module1.dirTemp &/ sPartHtml, sDecode) monHtml = File.Name(Module1.dirTemp &/ sPartHtml) ENDIF NEXT ENDIF ENDIF ENDIF FOR p = 0 TO .Message.Part.Count - 1 IF .Message.Part[p].ContentType LIKE "*image*" AND .Message.Part[p].ContentDisposition NOT LIKE "*attachment*" THEN ' .Message.Part[p].ContentId <> Null And sDecode = .Message.Part[p].Data sImage = .Message.Part[p].FileName File.Save(Module1.dirTemp &/ sImage, sDecode) monImage = File.Name(Module1.dirTemp &/ sImage) ENDIF IF .Message.Part[p].ContentDisposition LIKE "*attachment*" THEN sFileName = .Message.Part[p].FileName sDecode = .Message.Part[p].Data File.Save(Module1.dirTemp &/ sFileName, sDecode) monIndice += 1 maPiece.Add(File.Name(Module1.dirTemp &/ sFileName), monIndice) ENDIF NEXT maString1 = .Message.ToString() END WITH ENDIF Module1.POP.Close() Module1.POP = NULL ENDIF
END
|