用asp.net发送email
html1.htm ---------------------------------------------------------------------
<html>
<head>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form method="post" name="frmEmail" action="email.aspx" >
发送邮件给:<input type="text" name="mailto" size="30" value="someone@chinaasp.com"><br><br>
<input type="submit" value="ASP+ 邮件发送" name="cmdSubmit">
</form>
</body>
</html>
emal.aspx
---------------------------------------------------------------------
<%@ Import Namespace="System.Web.Util" %>
<script language="VB" runat=server ID=Script1>
Sub Page_load(Sender as Object, E as EventArgs)
Dim MyMail as New MailMessage
MyMail.To = request.form("mailto")
MyMail.From = "webmaster"
MyMail.Subject = "webmaster给您发了一封电子邮件"
MyMail.BodyFormat = MailFormat.Html
MyMail.Body = "<html><body><h1><a href='http://www.chinaasp.com'>ChinaASP.com</a> 使用ASP+程序给你发了一封EMail! Hohoho!</h1></body></html>"
SmtpMail.Send(MyMail)
End Sub
</script>
<html>
<head>
<title>ASP+邮件发送</title>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
一封HTML格式邮件发送到了:<br>
<h1><% response.write(request.form("mailto")) %></h1>
</body>
</html>