欢迎光临
我们一直在努力

利用CDONTS发送邮件的ASP函数

建站超值云服务器,限时71元/月

<%

last updated by recon on 05/14/2001

on error resume next

利用cdonts组件在win2k上发送邮件

发送普通邮件

sendmail "admin@ny.com", "iamchn@263.net", "normal mail!", "please check the attatchment!", 2, 0, "c:\love.txt"

发送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

参数说明

strfrom : 发件人email

strto : 收件人email

strsubject : 信件主题

strbody : 信件正文

lngimportance : 信件重要性

: 0 – 低重要性

: 0 – 中等重要性(默认)

: 0 – 高重要性

lngatype : 信件格式

: 为1时将邮件正文作为html(此时可以发送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

%>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 利用CDONTS发送邮件的ASP函数
分享到: 更多 (0)