EasyMailObjectコンポーネントを使用して、ASPのExchangeメールソースコードを処理します---メールの件名とサイズ(maillist1.asp)を読む
<%@言語= "vbscript"%>
<%
'******************************************* *****
'このファイルはすべての電子メールをリストし、メールコンテンツ表示ウィンドウを空白のウィンドウとして設定します
'著者:Awayeah
'電子メール:[email protected]
'******************************************* *****
%>
<スクリプト言語= vbscript>
parent.frmbottom.location.href = "blank.htm"
sub cmdel_onclick()
'メールを削除します
frmail.submit
End Sub
</script>
<%
session( "straccount")= ""またはsession( "strpassword")= "" then
respons.write( "<html> <title>エラー、まだログインしていません</title> <body> <p align = center> <br> <br>まだログインしていません、最初にログアウトしてください!<br > <br> ")
Response.write( "<a href = 'login.asp'ターゲット= '_ top'> <img src = 'http://www.newap.net/article/asp/example/2005/logout.jpg' border = 0 >/a> </p> </body> </html> ")
Response.End
ifを終了します
%>
<html>
<head>
<Title>電子メールを受信</title>
</head>
<style>
<! -
A {テキスト装飾:なし}
- >
</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
x <> 0の場合
Response.Write "<P align = center>接続エラー:" + cstr(x) + "<br> <br>管理者に連絡してください" "
pop3.disconnect
Response.End
ifを終了します
x = pop3.downloadMessages(0)
x <> 0の場合
response.write「エラーをダウンロード: " + cstr(x) +" <br> <br>管理者に連絡してください "
pop3.disconnect
Response.End
if>を終了します
<p> <br> </p>
<form name = "frmail" action = "mail_prc.asp" method = "post">
<center>
<Table CellPacing = "0" CellPadding = "0" bordercolor = "#000080" bgcolor = "#fffff">
<tr> <td colspan = 6 align = "center">
<%
'ページネーション処理
if request.querystring( "currentPage")= "" then
CP = 1
それ以外
cp = request.querystring( "currentPage")
ifを終了します
'電子メールの総数を取得します
m_count = pop3.messages.count
m_count <= 10 thenの場合
pagenum = 1
SD = 1
ed = m_count
それ以外
pagenum = int(m_count/10)+1
clng(cp)<> pagenumの場合
lastpage = m_count mod 10
sd =(clng(cp)-1)*10+1
ed = clng(cp)*10
それ以外
sd =(clng(cp)-1)*10+1
ed = m_count
ifを終了します
ifを終了します
%>
<font color = "ff00ff"> <%= pop3.messages.count%> </font>電子メールがあります。 </td>
<%session( "msgcount")= pop3.messages.count%>
</tr>
<tr>
<td align = "center"> number </td>
<td align = "center"> from/reply </td>
<td align = "center">テーマ</td>
<td align = "center"> date </td>
<td align = "center"> size </td>
<td align = "center"> select </td>
</tr>
<%i = sdからed%>の場合
<tr>
<td align = "center"> <%= i%> </td>
<%
fw = "Reply:"+cheplage(pop3.messages.item(i).subject、space(1)、 "_")
%>
<td>
<%Receiver = pop3.messages.item(i).from%>
<%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>
<%trim(receiver)= "" thenの場合
Response.write "anonymous </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>
<%msgid = pop3.getMessageId(i)%>
<a href = "showbody1.asp?id = <%= msgid%>"ターゲット= "frmbottom">
<font face = "宋体" size = "2">
<%
if trim(pop3.messages.item(i).subject)= "" then
response.write「トピックなし」
それ以外
respons.write pop3.messages.item(i).subject
ifを終了します
%> </font>
</a> </td>
<td> <font face = "宋体" size = "2"> <%= cdate(mid(cstr(pop3.messages.item(i)date)、6,11))%> </font> </ TD>
<tdwidth = "60"> <font face = "宋体" size = "2"> <%= pop3.messages.item(i).size%> </font> </td>
<td> <入力タイプ= "チェックボックス" name = "c <%= i%>" value = "<%= i%>"> </td>
</tr>
<%次へ
pop3.disconnect
%>
</table>
</center>
<p align = "center"> <入力タイプ= "ボタン" name = "cmdel" value = "delete"> </p>
</form>
<div align = "center">
<table cellpacing = "0" cellpadding = "0" bordercolor = "#ff0080" bgcolor = "#fffff">
<tr> <td>ページ</td>
<%i = 1からpagenum%>
<td> <a href = "maillist1.asp?currentPage = <%= i%>"ターゲット= frmtop> <%= i%> </a> </td>
<%next%>
</tr> </table> </div>
</body>
</html>