161 lines
6.0 KiB
Plaintext
161 lines
6.0 KiB
Plaintext
'Imports HigLabo
|
|
'Imports HigLabo.Net
|
|
'Imports HigLabo.Net.Mail
|
|
|
|
Partial Class Compras_RecepcionFacturas
|
|
Inherits System.Web.UI.Page
|
|
|
|
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
|
If Not IsPostBack Then
|
|
RecepcionFacturas()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub RecepcionFacturas()
|
|
Dim ObjPop As New HigLabo.Net.Pop3.Pop3Client("mail.adsistemas.mx", 110, "julian@adsistemas.mx", "Sia123654")
|
|
ObjPop.Ssl = False
|
|
If ObjPop.Authenticate() Then
|
|
|
|
Dim Mails As Long = ObjPop.GetTotalMessageCount()
|
|
Dim SB As New StringBuilder
|
|
SB.Append("<table border=""1"">")
|
|
|
|
SB.Append("<tr>")
|
|
SB.Append("<td>#</td>")
|
|
SB.Append("<td>De</td>")
|
|
SB.Append("<td>Asunto</td>")
|
|
'SB.Append("<td>BodyText</td>")
|
|
SB.Append("<td>Fecha</td>")
|
|
SB.Append("<td>IsAttachment</td>")
|
|
SB.Append("<td>IsBody</td>")
|
|
SB.Append("<td>IsHtml</td>")
|
|
SB.Append("<td>IsMultiPart</td>")
|
|
SB.Append("<td>IsText</td>")
|
|
SB.Append("<td>To</td>")
|
|
SB.Append("</tr>")
|
|
|
|
|
|
|
|
'For i As Integer = 1 To Mails
|
|
Dim i As Integer = 0
|
|
Try
|
|
Dim Mail As HigLabo.Net.Mail.MailMessage = ObjPop.GetMessage(29)
|
|
|
|
Dim TieneXML As Boolean = True
|
|
For Each ct As HigLabo.Net.Pop3.MailContent In Mail.Contents
|
|
If ct.FileName.Trim <> "" Then
|
|
TieneXML = True
|
|
SB.Append("<tr>")
|
|
SB.Append("<td colspan=""5"">" & ct.FileName & "</td>")
|
|
SB.Append("</tr>")
|
|
'ct.DecodeData("d:\mail\" & ct.FileName)
|
|
End If
|
|
Next
|
|
|
|
If TieneXML Then
|
|
SB.Append("<tr>")
|
|
SB.Append("<td>" & i & "</td>")
|
|
SB.Append("<td>" & Mail.From & "</td>")
|
|
SB.Append("<td>" & Mail.Subject & "</td>")
|
|
'SB.Append("<td>" & Mail.BodyText & "</td>")
|
|
SB.Append("<td>" & Mail.Date.ToString("dd/mm/yyyy hh:mm:ss") & "</td>")
|
|
SB.Append("<td>" & Mail.IsAttachment & "</td>")
|
|
SB.Append("<td>" & Mail.BodyText & "</td>")
|
|
SB.Append("<td>" & Mail.IsHtml & "</td>")
|
|
SB.Append("<td>" & Mail.IsMultiPart & "</td>")
|
|
SB.Append("<td>" & Mail.IsText & "</td>")
|
|
SB.Append("<td>" & Mail.To & "</td>")
|
|
SB.Append("</tr>")
|
|
End If
|
|
Catch ex As HigLabo.Net.SocketClientException
|
|
SB.Append("<tr>")
|
|
SB.Append("<td colspan=""5"">" & i & " ex.mess" & ex.Message & "</td>")
|
|
SB.Append("</tr>")
|
|
End Try
|
|
|
|
|
|
'Next
|
|
SB.Append("</table>")
|
|
Response.Write(SB.ToString)
|
|
End If
|
|
|
|
'Dim ObjPop As New HigLabo.Net.Pop3.Pop3Client("mail.adsistemas.mx", 110, "julian@adsistemas.mx", "Sia123654")
|
|
'ObjPop.Ssl = False
|
|
'If ObjPop.Authenticate() Then
|
|
|
|
' Dim Mails As Long = ObjPop.GetTotalMessageCount()
|
|
' Dim SB As New StringBuilder
|
|
' SB.Append("<table border=""1"">")
|
|
|
|
' SB.Append("<tr>")
|
|
' SB.Append("<td>Consec</td>")
|
|
' SB.Append("<td>Bcc</td>")
|
|
' SB.Append("<td>BodyData</td>")
|
|
' SB.Append("<td>BodyText</td>")
|
|
' SB.Append("<td>Cc</td>")
|
|
' SB.Append("<td>CharSet</td>")
|
|
' SB.Append("<td>Data</td>")
|
|
' SB.Append("<td>Date.ToString</td>")
|
|
' SB.Append("<td>From</td>")
|
|
' SB.Append("<td>IsAttachment</td>")
|
|
' SB.Append("<td>IsBody</td>")
|
|
' SB.Append("<td>IsHtml</td>")
|
|
' SB.Append("<td>IsMultiPart</td>")
|
|
' SB.Append("<td>IsText</td>")
|
|
' SB.Append("<td>Size</td>")
|
|
' SB.Append("<td>Subject</td>")
|
|
' SB.Append("<td>To</td>")
|
|
' SB.Append("</tr>")
|
|
|
|
|
|
|
|
' For i As Integer = 1 To Mails
|
|
' 'Dim i As Integer = 0
|
|
' Try
|
|
|
|
' Dim Mail As HigLabo.Net.Mail.MailMessage = ObjPop.GetMessage(20)
|
|
|
|
' SB.Append("<tr>")
|
|
' SB.Append("<td>" & i & "</td>")
|
|
' SB.Append("<td>" & Mail.Bcc & "</td>")
|
|
' SB.Append("<td>" & Mail.BodyData & "</td>")
|
|
' SB.Append("<td>" & Mail.BodyText & "</td>")
|
|
' SB.Append("<td>" & Mail.Cc & "</td>")
|
|
' SB.Append("<td>" & Mail.CharSet & "</td>")
|
|
' SB.Append("<td>" & Mail.Data & "</td>")
|
|
' SB.Append("<td>" & Mail.Date.ToString & "</td>")
|
|
' SB.Append("<td>" & Mail.From & "</td>")
|
|
' SB.Append("<td>" & Mail.IsAttachment & "</td>")
|
|
' SB.Append("<td>" & Mail.IsBody & "</td>")
|
|
' SB.Append("<td>" & Mail.IsHtml & "</td>")
|
|
' SB.Append("<td>" & Mail.IsMultiPart & "</td>")
|
|
' SB.Append("<td>" & Mail.IsText & "</td>")
|
|
' SB.Append("<td>" & Mail.Size & "</td>")
|
|
' SB.Append("<td>" & Mail.Subject & "</td>")
|
|
' SB.Append("<td>" & Mail.To & "</td>")
|
|
' SB.Append("</tr>")
|
|
|
|
' For Each ct As HigLabo.Net.Pop3.MailContent In Mail.Contents
|
|
' ct.DecodeHeaderText = True
|
|
' If ct.FileName.Trim <> "" Then
|
|
' SB.Append("<tr>")
|
|
' SB.Append("<td colspan=""16"">" & ct.FileName & "</td>")
|
|
' SB.Append("</tr>")
|
|
' ct.DecodeData("d:\mail\" & ct.FileName)
|
|
' End If
|
|
' Next
|
|
' Catch ex As HigLabo.Net.SocketClientException
|
|
' SB.Append("<tr>")
|
|
' SB.Append("<td colspan=""16"">" & i & " " & ex.Message & "</td>")
|
|
' SB.Append("</tr>")
|
|
' End Try
|
|
|
|
|
|
' Next
|
|
' SB.Append("</table>")
|
|
' Response.Write(SB.ToString)
|
|
'End If
|
|
|
|
End Sub
|
|
End Class
|