• 1
  • 2
  • 3
  • 4
  • 5
网站空间访问异常 首 页  »  帮助中心  »  虚拟主机  »  网站空间访问异常
虚拟主机CDOSYS发信组件使用参考
发布日期:2015-12-3 12:12:28

  一、asp程序参考

<% br="">'以下部分为系统配置,请勿更改 
Set objMail = Server.CreateObject("CDO.Message") 
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup" 
objCDOSYSCon.Fields.Update 
Set objMail.Configuration = objCDOSYSCon 
'系统配置结束 
'以下为用户自行更改部分,请由程序员进行修改 
objMail.From = "test@www.net.cn" 
objMail.Subject = "win2003发信组件测试" 
'把下面的email改成自己的 
objMail.To = "norelay@hichina.com" 
objMail.TextBody = "win2003测试发信组件正常" 
objMail.Send 
Set objMail = Nothing 
Set objCDOSYSCon = Nothing 
%> 
<%="发送成功!!!"%> 


  二、aspx程序参考

<% br="">'以下部分为系统配置,请勿更改 


dim objMail as object 
dim objCDOSYScon as object 


objMail = Server.CreateObject("CDO.Message") 
objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:Inetpub\mailroot\Pickup" 
objCDOSYSCon.Fields.Update 
objMail.Configuration = objCDOSYSCon 
'系统配置结束 
'以下为用户自行更改部分,请由程序员进行修改 
objMail.From = "test@www.yourdomain.com" 
objMail.Subject = "win2003发信组件测试" 
'把下面的email改成自己的 
objMail.To ="test@yourdomain.com" 
objMail.TextBody = "win2003测试发信组件正常" 
objMail.Send 
objMail = Nothing 
objCDOSYSCon = Nothing 
%> 
<%=>




<% br="">'以下部分为系统配置,请勿更改 


dim objMail as object 
dim objCDOSYScon as object 


objMail = Server.CreateObject("CDO.Message") 
objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:Inetpub\mailroot\Pickup" 
objCDOSYSCon.Fields.Update 
objMail.Configuration = objCDOSYSCon 
'系统配置结束 
'以下为用户自行更改部分,请由程序员进行修改 
objMail.From = "test@www.yourdomain.com" 
objMail.Subject = "win2003发信组件测试" 
'把下面的email改成自己的 
objMail.To ="test@yourdomain.com" 
objMail.TextBody = "win2003测试发信组件正常" 
objMail.Send 
objMail = Nothing 
objCDOSYSCon = Nothing 

  版权声明:本示例程序仅仅授权中国万网 ASP.NET 虚拟主机用户使用,其他任何方式均需经过中国万网书面授权方能使用。