最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
发送带附件的HTML格式邮件例程可以带附件
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
<%@ LANGUAGE=VBScript%>
<%
Response.Buffer = True
Response.Expires = 0
'创建对象实例
Set myMail = Server.CreateObject("CDONTS.NewMail")
'以下是将要发送的内容
HTML = ""
HTML = HTML & ""
HTML = HTML & "
HTML = HTML & ""
HTML = HTML & ""
HTML = HTML & "
"
HTML = HTML & "This is a test mail in html
"
HTML = HTML & "Mail content here ...
HTML = HTML & ""
HTML = HTML & ""
'发件人
myMail.From = "somebody@somewhere.com"
'收件人
myMail.To = "nobody@somewhere.com"
'密件抄送
myMail.Bcc = "nobody@somewhere.com"
'抄送
myMail.Cc = "nobody@somewhere.com"
'邮件的重要性
' 0 重要性低
' 1 重要性一般(默认)
' 2 重要性高
myMail.Importance = 2
'邮件主题
myMail.Subject = "Test mail in HTML"
'附件(注意 e: est.txt 指的是服务器上的位置,如果使用相对路径,必须用 Server.MapPath 映射为真实路径)
myMail.AttachFile "e: est.txt"
'NewMail 对象的文字格式
'0 表示该 Body 可包含超文本置标语言 (HTML)
'1 表示该 Body 只用于纯文本(默认值)
myMail.BodyFormat = 0
'NewMail 对象设置编码
'0 表示将采用 MIME 格式
'1 表示将采用连续的纯文本(默认值)
myMail.MailFormat = 0
'给邮件对象的文本赋值
myMail.Body = HTML
'将邮件发出
myMail.Send
'销毁对象实例,释放内存
Set myMail = Nothing
%>
-
上一个: 网页表单验证代码的改进
相关文章
- 邮件例程 - JavaMail - 发送HTML邮件 01-12
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16