asp.net和php发信组件

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



上一篇: 做u盘启动
下一篇: 创业者应有的十种无形资本
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 1485
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 邮件地址支持Gravatar头像,邮箱地址不会公开.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 300 字 | UBB代码 开启 | [img]标签 关闭