Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to ASP.NET need to send my form by email

Status
Not open for further replies.

csdewan

MIS
Apr 11, 2005
16
GB
Hi,
I have created an asp.net form that will caputure users inputs ie. name, address etc. I would now like to send all the data the form captures in an email. Do i have to use the SMTP mail component or is there another way. Do i link this to my submit button as well.
Bit unsure here any help would be great.
Thanks
 
You can use the System.Net.Mail.MailMessage class (or System.Web.Mail.MailMessage in version 1.1 of the framework).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks that is a great help. Does anyone know the best way to gather the information from say a few text boxes and so that it can then be sent in an email. Do i need to get the information in the text box to write to a list or label first then email that using System.Web.Mail.MailMessage.

Thanks
 
No, you can just read the information directly from the TextBox e.g.
Code:
myEmailMessage.Body = txtBody.Text


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top