mail2.asp

来自「较为详细的介绍了asp自定义的各种函数,方便asp的各种开发.」· ASP 代码 · 共 31 行

ASP
31
字号
<% 
'on error resume next
   receiver="hongceng_3@hotmail.com"
   mailbody="<html>"'邮件内容
   mailbody=mailbody & "<body>"
   mailbody=mailbody & "this is a texitsl"
   mailbody=mailbody & "</body>"
   mailbody=mailbody & "</html>"
   filename="g3.gif"          '附件文件名
   path=Server.MapPath("other/"&filename)     '附件的路径
set objmail=server.createobject("CDONTS.newmail")
    objmail.to= receiver  
    objmail.from="loveanseng@vip.net"'发送邮件
    objmail.subject="我是邮件标题"  
    objmail.body=mailbody
    objmail.bodyformat=0 
    objmail.MailFormat=0
    objmail.importance=2'邮件等级
    objmail.AttachFile path,filename 
    objmail.send
    set objmail=nothing

if err.number<>0 then 
   respnose.write err.description
   err.clear
else
   response.write "ok mail is sending "& receiver &" right."
end if
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?