EasyMailObject 구성 요소를 사용하여 ASP에서 Exchange Mail 소스 코드를 처리합니다-메일 컨텐츠 및 첨부 파일 (showbody1.asp)
< %@ language = "vbscript" %>
<%
'******************************************* ***********
'이 파일은 이메일의 내용과 첨부 파일을 보여줍니다.
'저자 : 멀리
'이메일 : [email protected]
'******************************************* ***********
%>
<html>
<헤드>
<title> 읽기 이메일 </title>
</head>
<body>
<%
set pop3 = session ( "pop3")
x = pop3.connect ()
x <> 0이면
응답. "연결 오류 :" + cstr (x)
pop3.disconnect
끝 If
y = pop3.download 헤드
j = pop3.getMessagenumfromid (request.querystring ( "id"))
msg = pop3. downloadsinglemessage (j)
'다운로드 된 메시지를 가리 키도록 메시지 객체를 설정하십시오
메시지 설정 = pop3.messages (msg)
'이메일 내용 표시
response.write replace (message.bodytext, chr (13), "<br>")
%>
<%
'메시지에 첨부 파일이 있으면 첨부 파일 이름과 파일 크기가 표시됩니다.
message.attachments.count> 0 인 경우%>
<p> </p>
<HR>
<테이블 테두리 = 1 align = "왼쪽"cellPacing = "0">
<tr> <td> 파일 이름 </td> <td> 크기 </td> <tr>
<%
k = 1 to message.attachments.count의 경우
response.write ( "<tr> <td>")%>
<a href =# onclick = javaScript : window.open ( 'seaveatt.asp? msgid = <%= j%> & attid = <%= k%>', 'getatt', 'width = 600, 높이 = 440, 스크롤 바 = 예 ');>
<%= message.attachments (k) .name%> </a> </td> <td>
<%response.write cstr (message.attachments (k) .Size)
응답. "</td> </tr>"
다음
%>
</테이블>
<%
끝 If
pop3.disconnect
%>
</body>
</html>