Author: krandall@randallnet.com | Posted on: 9/29/2009 10:05:31 AM | Views : 433

I've searched to no avail.  I am using a simple contact form, but I would like to add additional fields to it. Right now I have Email, Subject and Body. I would like to add maybe 12 more fields to be sent through smtp. The form works now as written, but what would my code behind look like with more fields? Here it is now:
'Add the namespace for the email-related classes Imports System.Net.Mail Partial Class _Default Inherits System.Web.UI.Page Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendEmail.Click '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS Const ToAddress As String = "MyEmailAddress@Email.com" '(1) Create the MailMessage instance Dim mm As New MailMessage(UsersEmail.Text, ToAddress) '(2) Assign the MailMessage's properties mm.Subject = Subject.Text mm.Body = Body.Text ...

Go to the complete details ...