在服务器上创建cdo对象, 例子如下:
<%
'&Oacute;&Ecirc;&frac14;&thorn;·&cent;&Euml;&Iacute;&ordm;&macr;&Ecirc;&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 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"
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Dim BodyParts 'As IBodyPart,
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.sina.com.cn" '&cedil;&Auml;&sup3;&Eacute;&iquest;&Eacute;&Oacute;&Atilde;&micro;&Auml;&Iacute;&acirc;&sup2;&iquest;&Oacute;&Ecirc;&frac14;&thorn;·&thorn;&Icirc;&ntilde;&AElig;÷&Oacute;ò&Atilde;&ucirc;
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "jb973@sina.com.cn" '&Ograve;&Ocirc;&Eacute;&Iuml;·&thorn;&Icirc;&ntilde;&AElig;÷&micro;&Auml;&Oacute;&Atilde;&raquo;§&Atilde;&ucirc;
.Item(cdoSendPassword) = "111111" '&Atilde;&Uuml;&Acirc;&euml;
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
Set BodyPart = objMessage.BodyPart
BodyPart.Fields("urn:schemas:mailheader:content-type") = "text/plain"
BodyPart.Charset = "gb2312"
BodyPart.Fields.Update
ASubject= ASubject+ " ---(&Agrave;&acute;×&Ocirc;jb973&Iacute;&not;&Ntilde;§&Acirc;&frac14
"
AContent= AContent &chr(13)_
&"----------------------------" &chr(13)_
& "&sup1;&Oslash;&Oacute;&Uacute;&Iacute;&not;&Ntilde;§&Acirc;&frac14;×&icirc;&frac12;ü&micro;&Auml;&Ccedil;é&iquest;&ouml;&pound;&not;&Ccedil;&euml;·&Atilde;&Icirc;&Ecirc;&pound;&ordm; http://jb973.126.com" &chr(13)_
& Now()
With objMessage
.To= AMailTo '&frac12;&Oacute;&Ecirc;&Otilde;&Otilde;&szlig;&micro;&Auml;&Oacute;&Ecirc;&frac14;&thorn;&micro;&Oslash;&Ouml;·
.From= AMailFrom '·&cent;&Euml;&Iacute;&Egrave;&Euml;&micro;&Auml;&Oacute;&Ecirc;&frac14;&thorn;&micro;&Oslash;&Ouml;·
.Subject= ASubject '±ê&Igrave;&acirc;
.TextBody= AContent '&Otilde;&yacute;&Icirc;&Auml;
.send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
End Sub
%>