Set pJmail = Server.CreateObject( "JMail.POP3" )
pJmail.Connect "username", "password", "mail.mydomain.com"
Response.Write( "你有 " & pJmail.count & " 封新邮件<br><br>" )
if pJmail.count > 0 then
Set msg = pJmail.Messages.item(1)
ReTo = ""
ReCC = ""
Set Recipients = msg.Recipients
separator = ", "
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
Set re = Recipients.item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.Name & " (" & re.EMail & ")" & separator
else
ReCC = ReTo & re.Name & " (" & re.EMail & ")" & separator
End If
Next
Function getAttachments()
Set Attachments = msg.Attachments
separator = ", "
For i = 0 To Attachments.Count - 1
If i = Attachments.Count - 1 Then
separator = ""
End If
Set at = Attachments(i)
at.SaveToFile( "c:\fujian\" & at.Name )
getAttachments = getAttachments & "<a href=""/fujian/" &_
at.Name &""">" & at.Name & "(" & at.Size & " bytes)" &_
"</a>" & separator
Next
End Function