Dim ReCC As String = ""
Dim pop3 As New POP3()
Dim msg As New Message()
Dim separator As String = ", "
Dim Attachments As New Attachments()
Dim re As New Recipient()
Dim ReTo As String = ""
Try
POP3.Connect('UserName','PassWord', 'POP3')
Catch
Page.RegisterStartupScript("", "<script language=JavaScript>window.alert('连接错误!!');</script>")
End Try
msg = POP3.Messages.Item(1)
Dim Recipients As New Recipients()
Recipients = msg.Recipients
Dim i As Integer
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
re = Recipients.Item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.Name & " <a href=""mailto:" & re.EMail & """>" & re.EMail & "</a>" & separator
Else
ReCC = ReTo & re.Name & " <a href=""mailto:" & re.EMail & """>" & re.EMail & "</a>" & separator
End If
Next
Function getAttachments() As String
Attachments = msg.Attachments
separator = ", "
Dim i As Integer
For i = 0 To Attachments.Count - 1
If i = Attachments.Count - 1 Then
separator = ""
End If
Dim at As New Attachment()
at = Attachments(i)
getAttachments = getAttachments & "<a href=""getAttachment.aspx?ai=" & i.ToString & "&eid=" & Request.QueryString("id") & """ target=""_blank"">" & _
at.Name & "(" & at.Size & " bytes)" & "</a>" & " "
Next
End Function