xqf222的专栏

ASP,JSP,ASP.NET,C#;Sql Server,Oracle,Informix累积历程和经验分享

CDONTS.DLL发送邮件代码.成功测试通过


EmailTitle="New Gold Store Order Information From WWW.GAMESAVOR.COM!("&now()&")"
EmailContent="WOW Gold Store Order Infomation:"&vbcrlf&vbcrlf
EmailFrom="gamesavor@126.com"
EmailTo="gamesavor@hotmail.com"


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

Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields

With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.126.com" '改成可用的外部邮件服务器域名
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "gamesavor" '以上服务器的用户名
.Item(cdoSendPassword) = "123456" '密码
.Update
End With

Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig

With objMessage
.To = EmailTo '改成接收者的邮件地址
.From =EmailFrom'改成发送人的邮件地址
.Subject = EmailTitle'标题
.TextBody = EmailContent'正文
'.AddAttachment "C:/Scripts/Output.txt"'邮件附件
.Send
End With

Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing

阅读更多
想对作者说点什么? 我来说一句

cdosys.dll

2011年09月17日 2MB 下载

cdonts.dll

2012年09月03日 393KB 下载

email.dll 用于发邮件

2013年07月06日 89KB 下载

没有更多推荐了,返回首页

不良信息举报

CDONTS.DLL发送邮件代码.成功测试通过

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭