EasyMailObjectコンポーネントを使用して、ASPでエクスチェンジメールソースコードを処理します。
<%@言語= "vbscript"%>
<%
'******************************************* *****
'このファイルには、電子メールのコンテンツと添付ファイルが表示されます
'著者:Awayeah
'電子メール:[email protected]
'******************************************* *****
%>
<html>
<head>
<Title>メールを読む</title>
</head>
<body>
<%
set pop3 = session( "pop3")
x = pop3.connect()
x <> 0の場合
Response.write "接続エラー:" + cstr(x)
pop3.disconnect
ifを終了します
y = pop3.downloadheaders
j = pop3.getMessagenumfromid(request.querystring( "id")))
msg = pop3.downloadsinglemessage(j)
'そのダウンロードされたメッセージを指すようにメッセージオブジェクトを設定します
メッセージ= pop3.messages(msg)を設定します
'電子メールの内容を表示します
Response.Writeの交換(message.bodytext、chr(13)、 "<br>")
%>
<%
「メッセージに添付ファイルがある場合、添付ファイル名とファイルサイズが表示されます
message.attachments.count> 0 then%>の場合
<p> </p>
<hr>
<テーブルボーダー= 1 align = "left" cellpacing = "0">
<tr> <td>ファイル名</td> <td>サイズ</td> <tr>
<%
k = 1へのmessage.attachments.countの場合
respons.write( "<tr> <td>")%>
<a href =#onclick = javascript:window.open( 'saveatt.asp?msgid = <%= j%>&attid = <%= k%>'、 'getatt'、 'width = 600、height = 440、scrollbars = yes ');>
<%= message.attachments(k).Name%> </a> </td> <td>
<%respons.write cstr(message.attachments(k).size)
Response.Write "</td> </tr>"
次
%>
</table>
<%
ifを終了します
pop3.disconnect
%>
</body>
</html>