<!–#include file="include/common.asp"–><br>
<!–#include file="include/func.asp"–><br>
<%<br>
last updated by recon on 05/14/2001<br>
on error resume next<br>
<br>
利用cdonts组件在win2k上发送邮件<br>
<br>
发送普通邮件<br>
sendmail "admin@ny.com", "iamchn@263.net", "normal mail!", "please check the attatchment!", 2, 0, "c:\love.txt"<br>
<br>
发送html邮件<br>
dim m_fso, m_tf<br>
dim m_strhtml<br>
<br>
set m_fso = server.createobject("scripting.filesystemobject")<br>
set m_tf = m_fso.opentextfile("c:\mail.htm", 1)<br>
m_strhtml = m_tf.readall<br>
<br>
write m_strhtml<br>
set m_tf = nothing<br>
set m_fso = nothing<br>
<br>
sendmail "admin@ny.com", "iamchn@263.net", "html mail!", m_strhtml, 2, 1, null<br>
<br>
参数说明<br>
strfrom : 发件人email<br>
strto : 收件人email<br>
strsubject : 信件主题<br>
strbody : 信件正文<br>
lngimportance : 信件重要性<br>
: 0 – 低重要性<br>
: 0 – 中等重要性(默认)<br>
: 0 – 高重要性<br>
lngatype : 信件格式<br>
: 为1时将邮件正文作为html(此时可以发送html邮件)<br>
strattach : 附件的路径<br>
sub sendmail(strfrom, strto, strsubject, strbody, lngimportance, lngatype, strattach)<br>
dim objmail<br>
<br>
set objmail = server.createobject("cdonts.newmail")<br>
with objmail<br>
<br>
.from = strfrom<br>
.to = strto<br>
.subject = strsubject<br>
.body = strbody<br>
.importance = lngimportance<br>
<br>
if lngatype = 1 then<br>
.bodyformat = 0<br>
.mailformat = 0<br>
end if<br>
<br>
if isempty(strattach) = false and isnull(strattach) = false then<br>
.attachfile strattach<br>
end if<br>
<br>
.send<br>
end with<br>
set objmail = nothing<br>
end sub<br>
%>
利用CDONTS发送邮件的ASP函数
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 利用CDONTS发送邮件的ASP函数
相关推荐
- 暂无文章
