国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

利用CDONTS發(fā)送郵件的ASP函數(shù)

2019-11-18 20:48:05
字體:
供稿:網(wǎng)友
<%
'Last Updated By Recon On 05/14/2001
'On Error Resume Next

'利用CDONTS組件在Win2k上發(fā)送郵件

'發(fā)送普通郵件
SendMail "admin@ny.com", "iamchn@263.net", "Normal Mail!", "Please check the attatchment!", 2, 0, "C:/Love.txt"

'發(fā)送HTML郵件
Dim m_fso, m_tf
Dim m_strHTML

Set m_fso = Server.CreateObject("SCRipTING.FILESYSTEMOBJECT")
Set m_tf = m_fso.OpenTextFile("C:/Mail.htm", 1)
m_strHTML = m_tf.ReadAll

'Write m_strHTML
Set m_tf = Nothing
Set m_fso = Nothing

SendMail "admin@ny.com", "iamchn@263.net", "HTML Mail!", m_strHTML, 2, 1, Null

'參數(shù)說明
'strFrom : 發(fā)件人Email
'strTo : 收件人Email
'strSubject : 信件主題
'strBody : 信件正文
'lngImportance : 信件重要性
' : 0 - 低重要性
' : 0 - 中等重要性(默認(rèn))
' : 0 - 高重要性
'lngAType : 信件格式
' : 為1時將郵件正文作為HTML(此時可以發(fā)送HTML郵件)
'strAttach : 附件的路徑
Sub SendMail(strFrom, strTo, strSubject, strBody, lngImportance, lngAType, strAttach)
Dim objmail

Set objMail = Server.CreateObject("CDONTS.NEWMAIL")
With objMail

.From = strFrom
.To = strTo
.Subject = strSubject
.Body = strBody
.Importance = lngImportance

If lngAType = 1 Then
.BodyFormat = 0
.MailFormat = 0
End If

If IsEmpty(strAttach) = False And IsNull(strAttach) = False Then
.AttachFile strAttach
End If

.Send
End With
Set objMail = Nothing
End Sub
%>



發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 博白县| 密山市| 繁峙县| 北宁市| 定襄县| 沂南县| 乾安县| 自治县| 宁陕县| 邢台市| 织金县| 大连市| 绥化市| 荣昌县| 丘北县| 冀州市| 望都县| 新闻| 大名县| 双城市| 南康市| 镶黄旗| 广东省| 方正县| 怀远县| 建瓯市| 仁怀市| 浦县| 封开县| 噶尔县| 台中市| 武强县| 东阿县| 阳新县| 河北区| 镇康县| 华阴市| 兖州市| 长丰县| 麻栗坡县| 井研县|