How to send messages in asp+

Source: Internet
Author: User
This article features you to send emails from a asp+ page. Using email from a 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!
This is the code
Page 1. The input form
<body>
<form method= "Post" Name= "Form1" action= "emailhtml2.aspx" >
Email address:<input type= "text" name= "EmailAddress" size= "value=" youremail@address.com >
<input type= "Submit" value= "Send Your Friend an Email using asp+" Name= "B1" >
</form>
</body>
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 ' from Aspfree using asp+ '
Note:we added the BodyFormat to show you to send
Formatted HTML remove and all HTML code in
Message. The email would send as regular text
Mymessage.bodyformat = mailformat.html
Mymessage.body = "href= ' http://aspfree.com ' >ASPFree.com</a> using asp+!Smtpmail.send (Mymessage)
End Sub
</script>
<title>email formatted HTML message with asp+</title>
<body>
You just sent a email message formatted in HTML to:<br>
</body>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.