sending an email from a webform?

B

bazzer

hello all,
as part of an application im developing with asp.net webforms, i need a
user whos using the application to be able to receive an email
confirmation of a booking they made using the application. how exactly
do you send an email using webforms?
 
A

Aytaç ÖZAY

Hi,

You can use smtp mail. It is a sample code for doing this at the bottom.

MailMessage email = new MailMessage();

email.To = txtBoxTo.Text;

email.From = txtBoxFrom.Text;

email.Subject = txtBoxSubject.Text;

email.Body = "Mail Body is here";

email.BodyFormat = MailFormat.Html;

smtpMail.SmtpServer = txtServer.Text;


smtpMail.Send(email);

----------------------Sample Code ends-------------------------------

Have a nice work,

Aytaç ÖZAY
Software Engineer
 
J

Juan T. Llibre

You are asking what's probably the most-often asked FAQ.

Maybe you should spend some time reading the ASP.NET FAQ :

http://asp.net.do/faq/default.aspx

This FAQ will show you how to ask questions in a way
that is likely to get you the answer you want to get : the right answer.

You have to do your part, too, if this is going to work out in such a way that you
*learn* what you need to learn, instead of getting ready-made answers which you
will promptly forget and need to ask for them again.

With that in mind, the first FAQ recommendation is that you use search engines to
find out if the question you intend to ask has been already answered in newsgroups.

Use resources like :

Google Advanced Group Search : http://groups.google.com/advanced_group_search
and
MSN Search : http://search.msn.com/

to search for the text of the problem which is stumping you, and save everybody the
waste of time that asking a FAQ entails. Remember : thousands of programmers will
read your post. Be considerate of their time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top