this article features how to send email from an asp+ page. using email from an asp+ page has many uses
(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>
