使用CDONTS發(fā)送郵件的幾個例子
當前位置:點晴教程→知識管理交流
→『 技術(shù)文檔交流 』
<!--#include file="include/common.asp"-->
<!--#include file="include/func.asp"--> <% 'Last Updated By Recon On 05/14/2001 'On Error Resume Next '利用CDONTS組件在Win2k上發(fā)送郵件 Dim objMail '普通郵件 '無主體 Set objMail = Server.CreateObject("CDONTS.NEWMAIL") objMail.From = "iamchn@263.net" objMail.To = "iamchn@21cn.com" objMail.Subject = "TEST1" objMail.Send Set objMail = Nothing '普通郵件 '有主體 Set objMail = Server.CreateObject("CDONTS.NEWMAIL") objMail.From = "iamchn@263.net" objMail.To = "iamchn@21cn.com" objMail.Subject = "TEST2" objMail.Body = "When i was young, i listened to the radio ..." objMail.Send Set objMail = Nothing '普通郵件 '有多送.有主體 Set objMail = Server.CreateObject("CDONTS.NEWMAIL") objMail.From = "iamchn@263.net" objMail.To = "iamchn@21cn.com;iamchn@263.net" objMail.Subject = "TEST3" objMail.Body = "When i was young, i listened to the radio ..." objMail.Send Set objMail = Nothing '普通郵件 '有抄送.有主體.有重要性 Set objMail = Server.CreateObject("CDONTS.NEWMAIL") objMail.From = "iamchn@263.net" objMail.To = "iamchn@21cn.com" objMail.Cc = "iamchn@263.net;recon_chan@sohu.com" objMail.Subject = "TEST4" objMail.Body = "When i was young, i listened to the radio ..." objMail.Importance = 2 objMail.Send Set objMail = Nothing '普通郵件 '有抄送.有暗送.有主體.有重要性 Set objMail = Server.CreateObject("CDONTS.NEWMAIL") objMail.From = "iamchn@263.net" objMail.To = "iamchn@21cn.com" objMail.Cc = "recon_chan@sohu.com" objMail.Bcc = "iamchn@263.net;recon_chan@sina.com" objMail.Subject = "TEST5" objMail.Body = "When i was young, i listened to the radio ..." objMail.Importance = 2 objMail.Send Set objMail = Nothing '普通郵件 '有主體.有重要性.含附件 Set objMail = Server.CreateObject("CDONTS.NEWMAIL") objMail.From = "iamchn@263.net" objMail.To = "iamchn@21cn.com" objMail.Subject = "TEST6" objMail.Body = "When i was young, i listened to the radio ..." objMail.Importance = 2 objMail.AttachFile "C:\Love.txt" objMail.Send Set objMail = Nothing 'HTML郵件 '有主體.有重要性 '注: AttachURL的使用可能有錯誤 Dim fso, tf Dim strHTML Set fso = Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT") Set tf = fso.OpenTextFile("C:\Mail.htm", 1) strHTML = tf.ReadAll Write strHTML Set tf = Nothing Set fso = Nothing Set objMail = Server.CreateObject("CDONTS.NEWMAIL") objMail.From = "iamchn@263.net" objMail.To = "iamchn@21cn.com" objMail.Subject = "TEST7" objMail.Body = strHTML objMail.BodyFormat = 0 objMail.MailFormat = 0 objMail.Importance = 2 objMail.AttachURL "c:\common.css", "common.css" objMail.AttachURL "c:\logo.gif", "logo.gif" objMail.Send Set objMail = Nothing %> 該文章在 2011/4/8 0:05:37 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |