使用asp发送邮件,中文的乱码问题。(300分)

  • 主题发起人 主题发起人 whbell
  • 开始时间 开始时间
W

whbell

Unregistered / Unconfirmed
GUEST, unregistred user!
我使用 CDO, 因为服务器只支持那个。
中文出现乱码。
 
<%
'&amp;Oacute;&amp;Ecirc;&amp;frac14;&amp;thorn;·&amp;cent;&amp;Euml;&amp;Iacute;&amp;ordm;&amp;macr;&amp;Ecirc;&amp;yacute;
Sub SendMail(AMailTo,AMailFrom,ASubject,AContent)
Const cdoSendUsingMethod="http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort=2
Const cdoSMTPServer="http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout="http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthen
ticate="http://schemas.microsoft.com/cdo/configuration/smtpauthen
ticate"
Const cdoBasic=1
Const cdoSendUserName="http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword="http://schemas.microsoft.com/cdo/configuration/sendpassword"
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.sina.com.cn" '&amp;cedil;&amp;Auml;&amp;sup3;&amp;Eacute;&amp;iquest;&amp;Eacute;&amp;Oacute;&amp;Atilde;&amp;micro;&amp;Auml;&amp;Iacute;&amp;acirc;&amp;sup2;&amp;iquest;&amp;Oacute;&amp;Ecirc;&amp;frac14;&amp;thorn;·&amp;thorn;&amp;Icirc;&amp;ntilde;&amp;AElig;÷&amp;Oacute;ò&amp;Atilde;&amp;ucirc;
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthen
ticate) = cdoBasic
.Item(cdoSendUserName) = "jb973@sina.com.cn" '&amp;Ograve;&amp;Ocirc;&amp;Eacute;&amp;Iuml;·&amp;thorn;&amp;Icirc;&amp;ntilde;&amp;AElig;÷&amp;micro;&amp;Auml;&amp;Oacute;&amp;Atilde;&amp;raquo;§&amp;Atilde;&amp;ucirc;
.Item(cdoSendPassword) = "1111" '&amp;Atilde;&amp;Uuml;&amp;Acirc;&amp;euml;
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
ASubject= ASubject+ " ---(&amp;Agrave;&amp;acute;×&amp;Ocirc;jb973&amp;Iacute;&amp;not;&amp;Ntilde;§&amp;Acirc;&amp;frac14;)"
AContent= AContent &amp;
chr(13) &amp;
" ------&amp;sup1;&amp;Oslash;&amp;Oacute;&amp;Uacute;&amp;Iacute;&amp;not;&amp;Ntilde;§&amp;Acirc;&amp;frac14;×&amp;icirc;&amp;frac12;ü&amp;micro;&amp;Auml;&amp;Ccedil;é&amp;iquest;&amp;ouml;&amp;pound;&amp;not;&amp;Ccedil;&amp;euml;·&amp;Atilde;&amp;Icirc;&amp;Ecirc;&amp;pound;&amp;ordm;
http://jb973.126.com " &amp;
chr(13) &amp;
Now()
With objMessage
.To= AMailTo '&amp;frac12;&amp;Oacute;&amp;Ecirc;&amp;Otilde;&amp;Otilde;&amp;szlig;&amp;micro;&amp;Auml;&amp;Oacute;&amp;Ecirc;&amp;frac14;&amp;thorn;&amp;micro;&amp;Oslash;&amp;Ouml;·
.From= AMailFrom '·&amp;cent;&amp;Euml;&amp;Iacute;&amp;Egrave;&amp;Euml;&amp;micro;&amp;Auml;&amp;Oacute;&amp;Ecirc;&amp;frac14;&amp;thorn;&amp;micro;&amp;Oslash;&amp;Ouml;·
.Subject= ASubject '±ê&amp;Igrave;&amp;acirc;
.TextBody= AContent '&amp;Otilde;&amp;yacute;&amp;Icirc;&amp;Auml;
.send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
End Sub
%>
 
发送给自己,受到邮件如下:
Return-Path: <jb973@sina.com>
Delivered-To: jb973@sina.com.cn
Received: (qmail 94613 invoked by alias);
21 Jul 2002 15:39:57 -0000
Received: from unknown (HELO 6115124816) (61.151.248.16)
by 202.106.187.143 with SMTP;
21 Jul 2002 15:39:57 -0000
From: <whbell@sina.com.cn>
To: <whbell@sina.com.cn>,
<jb973@sina.com.cn>
Subject: test ??---(??973???)
Date: Sun, 21 Jul 2002 23:47:57 -0700
Message-ID: <000401c2314b$b6c6df30$10f8973d@6115124816>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft CDO for Windows 2000
Thread-Index: AcIxS7anJQtn93skSNCCd0ox80nzxw==
Content-Class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
test ??---??????????,???:http://jb973.126.com------7/21/2002 11:47:57 PM
 
我也知道是字符集和 7bit 问题:
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
可是asp的代码如何编?
是不是CDO对象还有什么属性
 
解决问题再加100分。。。
 
我没有用CDONTS,因为服务器不支持。
 
不客气,我来了
 
接受答案了.
 
后退
顶部