如何解决用w3jmail43personal接收邮件后打开附件出现乱码的问题?

greentea888 2009-08-13 11:00:39
如何解决用w3jmail43personal接收邮件后打开附件出现乱码的问题?
...全文
74 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
greentea888 2009-08-13
  • 打赏
  • 举报
回复
或者有没有其它的接收邮件组件可以用啊,麻烦各位高手推荐一下,反正打开附件不出现乱码就行了。
greentea888 2009-08-13
  • 打赏
  • 举报
回复
怎么没人回贴啊,难道没有破解的办法吗?
超维电脑科技 2009-08-13
  • 打赏
  • 举报
回复
关注
greentea888 2009-08-13
  • 打赏
  • 举报
回复
TO:chinmo

我没看到你推荐的页面里有关于解决接收邮件的附件打开不出现乱码的问题啊。
  • 打赏
  • 举报
回复
你接受邮件的,建议你参考一下:
http://www.myziy.com/show.php?contentid=4

关于发信的你就看一下我的CSDN博客里的
greentea888 2009-08-13
  • 打赏
  • 举报
回复
大家请看上面的代码有什么问题?看怎么改使之接收下来的附件打开时不出现乱码。
greentea888 2009-08-13
  • 打赏
  • 举报
回复
<% @LANGUAGE=VBSCRIPT %>
<%

'*************************************************
'* *
'* Produced by Dimac *
'* *
'* More examples can be found at *
'* http://tech.dimac.net *
'* *
'* Support is available at our helpdesk *
'* http://support.dimac.net *
'* *
'* Our main website is located at *
'* http://www.dimac.net *
'* *
'*************************************************



Set pop3 = Server.CreateObject( "JMail.POP3" )

pop3.Connect "zqsf", "zqsf2009", "pop.21cn.com" 'pop.21cn.com

Response.Write( "You have " & pop3.count & " mails in your mailbox!<br><br>" )

if pop3.count > 0 then
For j = 1 To pop3.count
Set msg = pop3.Messages.item(j) ' Note the first element of this array is 1
' since the POP3 server starts counting at 1
ReTo = ""
ReCC = ""

Set Recipients = msg.Recipients
separator = ", "

' We now need to get all the recipients,
' both normal and Carbon Copy (CC) recipients
' and store them in a variabel

For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If

Set re = Recipients.item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.Name & " (<a href=""mailto:"& re.EMail &""">" & re.EMail & "</a>)" & separator
else
ReCC = ReTo & re.Name & " (<a href=""mailto:"& re.EMail &""">" & re.EMail & "</a>)" & separator
End If
Next


%>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<body>
<TABLE>
<tr>
<td>Subject</td>
<td><%= msg.Subject %></td>
</tr>
<tr>
<td>From</td>
<td><%= msg.FromName %></td>
</tr>
<tr>
<td>Recipients To</td>
<td><%= ReTO %></td>
</tr>
<tr>
<td>Recipients CC</td>
<td><%= ReCC %></td>
</tr>
<tr>
<td>Attachments</td>
<td><%= getAttachments %></td>
</tr>
<tr>
<td>Body</td>
<td><pre><%= msg.Body %></pre></td>
</tr>
</TABLE>
</body>
</html>
<%
Response.Flush()
Next
' This function iterates through the Attachments object,
' and saves the attachment to the server's disk.
' It also returns a nicely formatted string with a
' link to the attachment.
Function getAttachments()
Set Attachments = msg.Attachments
separator = ", "

For i = 0 To Attachments.Count - 1
If i = Attachments.Count - 1 Then
separator = ""
End If
savepath=Year(Date)&Month(Date)&Day(Date)&Hour(Now)&Minute(Now)&Second(Now)
Set at = Attachments(i)
mypath = "../../EMail/attachments/" & at.Name
Response.Write(mypath&"<BR>")
at.SaveToFile(Server.MapPath(mypath))
getAttachments = getAttachments & "<a href=""../../EMail/attachments/" & at.Name &""">" &_
at.Name & "(" & at.Size & " bytes)" & "</a>" & separator
Next
End Function

end if

pop3.Disconnect

%>
greentea888 2009-08-13
  • 打赏
  • 举报
回复
<% @LANGUAGE=VBSCRIPT %>
<%
Set pop3 = Server.CreateObject( "JMail.POP3" )
pop3.Connect "zqsf", "zqsf2009", "pop.21cn.com" 'pop.21cn.com
Response.Write( "You have " & pop3.count & " mails in your mailbox!<br><br>" )
if pop3.count > 0 then
For j = 1 To pop3.count
Set msg = pop3.Messages.item(j) ' Note the first element of this array is 1 ' since the POP3 server starts counting at 1
ReTo = ""
ReCC = ""
Set Recipients = msg.Recipients
separator = ", "
' We now need to get all the recipients,
' both normal and Carbon Copy (CC) recipients
' and store them in a variabel
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
Set re = Recipients.item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.Name & " (<a href=""mailto:"& re.EMail &""">" & re.EMail & "</a>)" & separator
else
ReCC = ReTo & re.Name & " (<a href=""mailto:"& re.EMail &""">" & re.EMail & "</a>)" & separator
End If
Next

Function getAttachments()
Set Attachments = msg.Attachments
separator = ", "

For i = 0 To Attachments.Count - 1
If i = Attachments.Count - 1 Then
separator = ""
End If
savepath=Year(Date)&Month(Date)&Day(Date)&Hour(Now)&Minute(Now)&Second(Now)
Set at = Attachments(i)
mypath = "../../EMail/attachments/" & at.Name
Response.Write(mypath&"<BR>")
at.SaveToFile(Server.MapPath(mypath))
getAttachments = getAttachments & "<a href=""../../EMail/attachments/" & at.Name &""">" &_
at.Name & "(" & at.Size & " bytes)" & "</a>" & separator
Next
End Function
%>
mailbao 2009-08-13
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 hookee 的回复:]
不要设ContentType即可
[/Quote]

頂~

asp收發郵件的組件優先推薦還是 jmail

把JMail.ContentType="text/html"這句注釋一下看看是否OK?
hookee 2009-08-13
  • 打赏
  • 举报
回复
不要设ContentType即可
  • 打赏
  • 举报
回复
乱码是编码造成的,自己看下编码的问题

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧