上一篇:在Windows桌面上使用WSH接收邮件 >>
如何在ASP+中发送邮件
(Notify of errors, inform people about a a subject. etc..). This code sample sends a formatted HTML
message to the email address entered. Enjoy this free code!
Here is the code
Page 1. The input form
<html>
<head>
</head>
<body>
<form method="post" name="form1" action="emailhtml2.aspx">
Email Address:<input type="text" name="EmailAddress" size="30" value="youremail@address.com"><br><br>
<input type="submit" value="Send Your Friend an Email using ASP+" name="b1">
</form>
</body>
</html>
Page 2. Sends the email code
<%@ Import Namespace="System.Web.Util" %>
<script language="VB" runat=server>
Sub Page_load(Sender as Object, E as EventArgs)
Dim MyMessage as New MailMessage
MyMessage.To = request.form("EmailAddress")
MyMessage.From = "webmaster"
MyMessage.Subject = "This is message is from ASPFree using ASP+"
Note:We added the BodyFormat to show how to send
formatted HTML remove this line and all the HTML code in
message. The email will send as regular text
MyMessage.BodyFormat = MailFormat.Html
MyMessage.Body = "<html><body><h1>You received this email from <a
href=@#http://aspfree.com@#>ASPFree.com</a> using ASP+!</h1></body></html>"
SmtpMail.Send(MyMessage)
End Sub
</script>
<html>
<head>
<title>Email Formatted HTML message with ASP+</title>
</head>
<body>
You just sent an email message formatted in HTML to:<br>
<h1><% response.write(request.form("EmailAddress")) %></h1>
</body>
</html>
下一篇:asp电子报制作与程序 >>
相关文章:
- · 遍历目录以及目录下文件的函数
- · vithink小文件自动实现文件浏览下载
- · 用asp实现的代码批量修改程序,fso相关
- · fso实例
- · 使用FSO把文本信息导入数据库
- · 在线实时开通FTP&WEB
- · 对文件的操作--建立移动删除文件夹
- · 一个实用的FSO-实时统计在线人数
- · 利用FSO取得BMP,JPG,PNG,GIF文件信息
- · 三种禁用FileSystemObject组件的方法
- · 遍历目录以及目录下文件的函数
- · 在线修改Serv-U 4.2用户密码
- · asp 中常用的文件处理函数
- · 使用FSO把文本信息导入数据库
- · FSO+递归生成文件列表(xml)
- · 文件遍历排序函数
- · 利用FSO取得BMP,JPG,PNG,GIF文件信息
- · fso的一些特殊功能
- · 三种禁用FileSystemObject组件的方法
- · fso的一些特殊功能
- · 利用FSO取得BMP,JPG,PNG,GIF文件信息
- · 三种禁用FileSystemObject组件的方法
- · 清空iis log 中自己登录ip的vbs
- · fso的一些特殊功能
- · 使用FSO按文件大小浏览文件目录并进行删除操作
- · NAV导致IIS调用FSO失败的解决方法
- · 构建免受 FSO 威胁虚拟主机(三)
- · 构建免受 FSO 威胁虚拟主机(二)
- · 构建免受 FSO 威胁虚拟主机(一)
- · 类似于iis浏览的功能
- · 巧用FileSystem组件实现WEB应用中的本地特定打印
- · ASP中FSO对象对IIS WEB服务器数据安全的威胁及对策
- · 文件的读出 编辑 管理
- · 怎样判断一个盘上是否有文件
- · 用ASP实现对MP3曲目信息的操作
- · 关于用ADO STREAM做的无组件上传程序简单介绍
- · 从文本文件中读取信息并存储入数据库
- · 文本搜索
