% Set pop3 = Server.CreateObject( "JMail.POP3" )
pop3.Connect "username", "password", "pop3mail.intels.net"
' POP3的連接用戶名,密碼,POP3地址.
Response.Write( "你現(xiàn)在有" pop3.count " 封郵件。br>br>" )
if pop3.count > 0 then
Set msg = pop3.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 "(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()
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:\intels\email\attachments\" at.Filename )
getAttachments = getAttachments "a href=""/intels/email/attachments/" at.Filename """>" _
at.FileName "(" at.Size " bytes)" "/a>" separator
Next
End Function
' 以上是程序得到附件,并保存到服務(wù)器上,也可返回附件鏈接.
%>
html>
body>
TABLE>
tr>
td>主題:撼雪噴云向你問好!/td>
td>%= msg.Subject %>/td>
/tr>
tr>
td>發(fā)件人:李雁冰@163.net/td>
td>%= msg.FromName %>/td>
/tr>
tr>
td>收件人:宋顏浩@163.net/td>
td>%= ReTO %>/td>
/tr>
tr>
td>抄送:申朝陽@163.net/td>
td>%= ReCC %>/td>
/tr>
tr>
td>附件:隨風起舞的傳說/td>
td>%= getAttachments %>/td>
/tr>
tr>
td>內(nèi)容:烏里哇啦烏里哇啦……/td>
td>pre>%= msg.body %>/pre>/td>
/tr>
/TABLE>
/body>/html>
% end if
pop3.Disconnect
%>
[1]
您可能感興趣的文章:- java使用Socket實現(xiàn)SMTP協(xié)議發(fā)送郵件
- Java+Nginx實現(xiàn)POP、IMAP、SMTP郵箱代理服務(wù)
- java實現(xiàn)基于SMTP發(fā)送郵件的方法
- 深入Lumisoft.NET組件POP3郵件接收與刪除操作的使用詳解
- 提示Outlook/Foxmail收取163郵件失?。篍RR 您沒有權(quán)限使用pop3功能
- 手工體驗smtp和pop3協(xié)議 郵件實現(xiàn)詳解(二)