AspEmail是一个在ASP或则VB环境中使用外部SMTP服务器发送电子邮件消息的活动服务组件。
AspEmail 支持多收件人,多CC, 多Bcc,多附件,HTML格式, 内嵌图形, 和非US ASCII字符集设置. A
spEmail 是一个完全免费的组件,除了内嵌图形功能、Quoted-Printable编码支持功能、消息队列功能需要另外的购买许可外这份完全免费的AspEmail可以www.aspemail.com处下载。
关于其使用方法
http://www.aspxuexi.com/component/2006-5-11/aspemail.htm
国内多个下载站有该软件的下载地址。
AspEmail是和AspUpload(Persits Software, Inc.)组件评估版本一同发布的。
下面是实际例子
<%
Set Mail = Server.CreateObject("Persits.MailSender")
%>
跟随AspEmail发布的还有一个ASP例子程序,该例子允许你通过Web建立和发送有附件的邮件。
该例子程序由下面几个文件组成:
global.asa (collection object creation)
SendMail.asp (main Email interface page)
Attachments.asp (attachment handling page)
UploadScript.asp (upload script which uses AspUpload).
要正确使用这个例子的话,请正确注册ASPUpload组件试用版本
Host String(必须) SMTP服务器的主机名称
Port Integer SMTP的端口号,默认为25.
From String(必须) 发件人的email地址
FromName String 发件人的名称
Subject String 消息的主题
Body String 消息的正文.可以是文本也可以是HTML格式.如果是后者,那么属性IsHTML必须为True.
IsHTML Boolean 默认值为False.如果被设置为True, AspEmail将设置消息的Content-Type部分为text/html.
Priority Integer 消息的优先权.合法值为1 (高), 3 (普通) 和5 (底). 默认为0(即没指定优先级).
Helo String 默认值为"AspEmail".当SMTP对话开始后该字符串随HELO命令被发送.用来SMTP的客户端标识SMTP服务器的域名
例如下面的这个过程:
sub sendMail(a_intID , a_strEmail) const c_strMailServer = "smtp.163.com" dim objConn,objRs,strSql dim strContent,strBody,strSubject,objEmail
strBody = "<html><head>" strBody = strBody& "<meta HTTP-EQUIV=Content-Type content=text/html; charset=gb2312>" strBody = strBody & "</head><body >" strBody = strBody &"<p>"&"这里是www.aspxuexi.com" & "</p>" strBody = strBody + "</body></html>"
'发送email 'on error resume next set objEmail = server.CreateObject("Persits.MailSender") objEmail.Host = c_strMailServer objEmail.From = "web@aspxuexi.com " objEmail.FromName = "asp学习网" objEmail.AddAddress a_strEmail objEmail.Subject = "测试" objEmail.IsHTML = true objEmail.CharSet = "gb2312" objEmail.Body = strBody objEmail.Send
'检察错误 if Err.number = 0 then '如果成功 Response.Write ("<p align=center class=cn>为确保用户不被骚扰,我们将发出确认信,请访问信中的URL以确认登记</td>") else '如果失败则显示出错原因 Response.Write ("<p align=center class=cn>邮件发送出错,错误原因:<br>") Response.Write ("<font color=red>"&Err.Description&"</font></td>") end if
'清场 set objEmail = nothing end sub
使用该过程: <% .....
RTSEmail GuestMailID,""&email&"" .....
%>
|