全部产品
阿里云办公

M型windows虚拟主机CDOSYS发信组件示例

更新时间:2017-06-07 13:26:11

  • CDOSYS示例 


     <%
       '以下部分为系统配置,请勿更改
       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 = "
    you@yourhouse.com"
       objMail.Subject = "CDOSYS Mail Message"
       objMail.To = "
    yourfriend@otherdomain.com"
       objMail.TextBody = "Hello World"
       objMail.Send
      
      
       Set objMail = Nothing
       Set objCDOSYSCon = Nothing
      
       %>


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

    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
    %>

    <%="发送成功, ok!!!"%>

    备注:

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