高分求解CDO发送邮件乱码问题,在线等待中!!!!
用下面函数发送邮件接收后是乱码,help,help!!!!
<%
function mail(smtpserver,user,password,email,from,Subject,Body,htmlbody)
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 cdoSMTPAuthenticate="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic=1
Const cdoSendUserName="http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword="http://schemas.microsoft.com/cdo/configuration/sendpassword"
Const cdoSendlanguagecode="http://schemas.microsoft.com/cdo/configuration/languagecode"
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)=smtpserver
.Item(cdoSMTPServerPort)=25
.Item(cdoSMTPConnectionTimeout)=10
.Item(cdoSendlanguagecode)="gb2312"
.Item(cdoSMTPAuthenticate)=cdoBasic
.Item(cdoSendUserName)=user
.Item(cdoSendPassword)=password
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
with objMessage
Set .Configuration = objConfig
.To=email
.From=from
.Subject=Subject
if trim(htmlbody)<>"" then
.HTMLBody=htmlbody
else
.TextBody=body
end if
.Send
end with
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
if err.number=0 then
mail="您给 <font color='#FF0000'>"&email&"</font> 的通知邮件已发出"
else
mail="您给 <font color='#FF0000'>"&email&"</font> 的通知邮件发送失败"
end if
end function
%>