<% set pop3 = server.createobject( "jmail.pop3" )
pop3.connect "username", "password", "pop3mail.intels.net"
' pop3的连接用户名,密码,pop3地址.
response.write( "你现在有" & 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
' 以上是程序得到附件,并保存到服务器上,也可返回附件链接.
%>
<html>
<body>
<table>
<tr>
<td>主题:撼雪喷云向你问好!</td>
<td><%= msg.subject %></td>
</tr>
<tr>
<td>发件人:李雁冰@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>内容:乌里哇啦乌里哇啦……</td>
<td><pre><%= msg.body %></pre></td>
</tr>
</table>
</body></html>
<% end if
pop3.disconnect
%>
[1]
如对本文有疑问, 点击进行留言回复!!
VBA处理数据与Python Pandas处理数据案例比较分析
IntelliJ IDEA2020新增禅模式和LightEdit模式
IntelliJ IDEA 2020如何设置背景图片的方法步骤
网友评论