最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
使用CDO通过外部邮件服务器发邮件 (免安装其他邮件组件)
时间:2022-06-30 11:35:09 编辑:袖梨 来源:一聚教程网
使用CDO通过外部邮件服务器发邮件 (免安装其他邮件组件)
John Peterson [ hooke 编译 ]
WIN2K下的CDO或CDONTS被默认配置成只能通过本地的Microsoft SMTP服务来发送邮件,如果要用外部的邮件服务器,一般要安装第三方组件。以下代码教你如何利用CDO通过外部邮件服务器发送邮件。(译者win2000下测试通过。)
Const cdoSendUsingMethod="http://schemas.mi**croso*ft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort=2
Const cdoSMTPServer="http://schemas.mic*ro*s*oft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort="http://schemas.mic*ro*s*oft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout="http://schemas.mic*r*o*soft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate="http://schemas.mi***crosoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic=1
Const cdoSendUserName="http://schemas.*m*ic*rosoft.com/cdo/configuration/sendusername"
Const cdoSendPassword="http://schemas.**microsof*t.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) = "sony.com" '改成可用的外部邮件服务器域名
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "hooke" '以上服务器的用户名
.Item(cdoSendPassword) = "mypassword" '密码
John Peterson [ hooke 编译 ]
WIN2K下的CDO或CDONTS被默认配置成只能通过本地的Microsoft SMTP服务来发送邮件,如果要用外部的邮件服务器,一般要安装第三方组件。以下代码教你如何利用CDO通过外部邮件服务器发送邮件。(译者win2000下测试通过。)
Const cdoSendUsingMethod="http://schemas.mi**croso*ft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort=2
Const cdoSMTPServer="http://schemas.mic*ro*s*oft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort="http://schemas.mic*ro*s*oft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout="http://schemas.mic*r*o*soft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate="http://schemas.mi***crosoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic=1
Const cdoSendUserName="http://schemas.*m*ic*rosoft.com/cdo/configuration/sendusername"
Const cdoSendPassword="http://schemas.**microsof*t.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) = "sony.com" '改成可用的外部邮件服务器域名
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "hooke" '以上服务器的用户名
.Item(cdoSendPassword) = "mypassword" '密码
相关文章
- 荒原曙光奇物愈合珍珠怎么获得 奇物愈合珍珠获取攻略 10-15
- 荒原曙光黏土怎么获得 黏土获取攻略 10-15
- 荒原曙光奇物收容箱子怎么获得 奇物收容箱子获取攻略 10-15
- 荒原曙光雪莲怎么获得 雪莲获取攻略 10-15
- 荒原曙光怎么驯服动物 驯服动物方法 10-15
- 洛克王国世界火灵石怎么获得 火灵石获取攻略 10-15