Use JMail to do the procedure of receiving email attachment (turn)
Source: Internet
Author: User
Use JMail to do the procedure of collecting mail attachment
July 6, 2001
I am now using ASP to do a Web mail processing program, and online 263,163 of the Web e-mail.
When I was making my own web mail system, I used the very popular ASP mail processing components Aspmail and jmail to make Web mail for the sender and the Inbox, and now the problem is that when I use my web Inbox to collect an email with attachments, The downloaded attachment will be corrupted (for example: I pasted a 50k size JPG image attachment in the mail, but when the Web application closed down the picture size becomes 40k, and the picture is opened after the image is not visible, I originally thought that the JMail the mail component itself has the bug, But I also used the other use in the ASP in the collection of mail components, or the same old.
Also need to explain that the mail itself is not a problem, I use mail client software to receive this message is no problem.
Here is a demo of my program, do not know you have no programming experience in this area, help me solve this problem.
<% @LANGUAGE =vbscript%>
<%
Set POP3 = Server.CreateObject ("jmail.pop3") ' Create object
POP3. Connect "Pzhou", "Pzhou", "10.157.11.42" ' Connecting server Pop3.connect User,password,host
Response.Write ("You have" & Pop3.count & "mails in your mailbox!<br><br>")
Set Msg=server. CreateObject ("Jmail.message")
If Pop3.count > 0 Then
Set msg = POP3. Messages.item (1)
Separator = ","
Function getattachments () ' Get attachment
Set Attachments = Msg. Attachments
Separator = ","
Response.Write "<br>" &msg.size& "<br>"
For i = 0 to Attachments.count-1
If i = attachments.count-1 Then
Separator = ""
End If
Set at = Attachments (i)
At. SaveToFile ("E:" & at. Name)
getattachments = getattachments & "<a href=" "& at. Name & "" > "&_
At. Name & "(" & at. Size & "bytes" & "</a>" & Separator
Next
End Function
%>
<body>
<TABLE>
<tr>
<td>Subject</td>
<td><%= Msg. Subject%></td>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.