前往顾页
以后地位: 主页 > 收集编程 > .Net实例教程 >

asp.net和php发信组件法度代码

时候:2011-09-03 16:49来源:知行网www.zhixing123.cn 编辑:麦田守望者

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

 

 

备注:

1、asp法度示例。

<%
'以下部分为体系建设,请勿变动
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:\InetpubmailrootPickup"
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
%>
<%="发送成功!!!"%>

2、aspx法度示例。

<%
'以下部分为体系建设,请勿变动

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:InetpubmailrootPickup"
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!!!"%>

------分开线----------------------------
标签(Tag):C# C#实例教程 c#根本教程 C#源代码 c#技能
------分开线----------------------------
保举内容
猜你感兴趣