| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 719 人关注过本帖
标题:在ASP中用EasyMailObject组件处理Exchange邮件源代码
只看楼主 加入收藏
vcrhome
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-7-14
收藏
 问题点数:0 回复次数:6 
在ASP中用EasyMailObject组件处理Exchange邮件源代码

读取邮件主题和大小(maillist1.asp)
<%@ LANGUAGE="VBSCRIPT" %>

<script language=vbscript>
parent.frmbottom.location.href="blank.htm"
sub cmdel_onClick()
'删除邮件
frmail.submit
end sub
</script>
<%
if session("straccount")="" or session("strpassword")="" then
Response.write ("<html><title>错误,尚未登录</title><body><p align=center><br><br>你尚未登录,请先退出登录!<br><br>")
Response.Write ("<a href='login.asp' target='_top'><img src='logout.jpg' border=0></a></p></body></html>")
Response.End
end if
%>
<html>
<head>
<title>收邮件</title>
</head>
<STYLE>
<!--
A{text-decoration:none}
-->
</STYLE>
<body bgcolor="#008080" text="#000000">
<%
'定义邮件服务器地址
strserver=session("strserver")
'定义帐号
strAccount=session("straccount")
'定义密码
strPassword=session("strpassword")
'设置组件的各种属性
Set POP3 = CreateObject("EasyMail.POP3.5")
POP3.LicenseKey = "awa/S19I500R1AX30C0R3100"
POP3.MailServer = strServer
POP3.Account = strAccount
POP3.Password = strPassword
pop3.PreferredBodyFormat=1
pop3.TimeOut=120

x = POP3.Connect
If x <> 0 Then
Response.Write "<p align=center>连接错误: " + CStr(x) + "<br><br>请和管理员联系"
POP3.Disconnect
Response.End
End If

x = POP3.DownloadMessages(0)
If x <> 0 Then
Response.Write "下载错误: " + CStr(x) +"<br><br>请和管理员联系"
POP3.Disconnect
Response.End
End If%>
<p><br></p>
<form name="frmail" action="mail_prc.asp" method="POST">
<center>
<table border="1" width="580" cellspacing="0" cellpadding="0" bordercolor="#000080" bgcolor="#FFFFFF">
<tr><td colspan=6 align="center">
<%
'分页处理
if Request.QueryString("currentpage")="" then
cp=1
else
cp=Request.QueryString("currentpage")
end if
'得到邮件总数
m_count=POP3.Messages.Count
if m_count<=10 then
pagenum=1
sd=1
ed=m_count
else
pagenum=int(m_count/10)+1
if clng(cp)<>pagenum then
lastpage=m_count mod 10
sd=(clng(cp)-1)*10+1
ed=clng(cp)*10
else
sd=(clng(cp)-1)*10+1
ed=m_count
end if
end if
%>
你有<font color="ff00ff"><%=POP3.Messages.Count%></font>封邮件。</td>
<%session("msgcount")=POP3.Messages.Count%>
</tr>
<tr>
<td align="center" width="20">号</td>
<td align="center" width="120">来自/回复</td>
<td align="center" width="270">主题</td>
<td align="center" width="90">日期</td>
<td align="center" width="60">大小</td>
<td align="center" width="20">选择</td>
</tr>
<%for i= sd to ed%>

<tr>
<td align="center" width="20"><%=i%></td>
<%
fw="回复:"+replace(POP3.messages.item(i).subject,space(1),"_")
%>
<td width="100">
<%receiver=POP3.Messages.item(i).from%>
<%if POP3.Messages.item(i).fromaddr="" then%>
<a href="">
<%else
%>
<a href=# onClick=javascript:window.open('sendmail1.asp?addr=<%=pop3.messages.item(i).fromaddr%>&subject=<%=fw%>','sendnew','width=600,height=480,scrollbars=yes');>
<%end if%>
<%if trim(receiver)="" then
response.write "匿 名</a>"%>
<%else%>
<a href=# onClick=javascript:window.open('sendmail1.asp?addr=<%=pop3.messages.item(i).fromaddr%>&subject=<%=fw%>','sendnew','width=600,height=480,scrollbars=yes');>
<font face="宋体" size="2">
<%=POP3.Messages.item(i).From%></font>
<%end if%>
</td>
<td width="270">

<%msgid=POP3.GetMessageID(i)%>
<a href="showbody1.asp?id=<%=msgid%>" target="frmbottom">
<font face="宋体" size="2">
<%
if trim(POP3.messages.item(i).Subject)="" then
response.write "无主题"
else
response.write POP3.messages.item(i).Subject
end if
%></font>
</a></td>
<td width="90"><font face="宋体" size="2"><%=cdate(mid(cstr(POP3.messages.item(i).date),6,11))%></font></td>

<td width="60"><font face="宋体" size="2"><%=POP3.messages.item(i).size%></font></td>
<td><input type="checkbox" name="c<%=i%>" value="<%=i%>"></td>
</tr>
<%next
POP3.Disconnect

%>
</table>
</center>
<p align="center"><input type="button" name="cmdel" value="删除"></p>
</form>
<div align="center">
<table border="1" cellspacing="0" cellpadding="0" bordercolor="#ff0080" bgcolor="#FFFFFF">
<tr><td>页数</td>
<%for i=1 to pagenum%>
<td><a href="maillist1.asp?currentpage=<%=i%>" target=frmtop> <%=i%> </a></td>
<%next%>
</tr></table></div>

</body>
</html>

[此贴子已经被静夜思于2007-8-23 9:41:23编辑过]

搜索更多相关主题的帖子: 源代码 Exchange 组件 邮件 ASP 
2007-07-14 08:58
vcrhome
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-7-14
收藏
得分:0 

没人回?

2007-07-15 09:04
坠落靓点
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-7-11
收藏
得分:0 
正在考虑中!!!!~~`
2007-07-16 07:57
vcrhome
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-7-14
收藏
得分:0 

还有人回呀!!

2007-07-16 17:37
vcrhome
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-7-14
收藏
得分:0 

顶贴!!

2007-07-17 17:32
vcrhome
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2007-7-14
收藏
得分:0 
顶贴!
2007-07-23 07:24
longye
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2007-7-23
收藏
得分:0 
EasyMail没用过,JMAIL用的不少
2007-07-23 12:05
快速回复:在ASP中用EasyMailObject组件处理Exchange邮件源代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023393 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved