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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending email from a web form app

Status
Not open for further replies.

spyG5

Programmer
Jun 3, 2003
10
PH
hi all,

how do i send an email from a web form app to someone?
is there anything special i need to do to be able to use the SmtpMail class?

i found the below sample code but it's not working for me as I can't seem to be able to use the System.Web.Mail namespace in my program. I'm using VS.Net 2002.

MailMessage myMail = new MailMessage();
myMail.From = "my_email_address";
myMail.To = "email_address_i_want_to_send_email_to";
myMail.Subject = "UtilMailMessage001";
myMail.Priority = MailPriority.Low;
myMail.BodyFormat = MailFormat.Html;
myMail.Body = &quot;<html><body>UtilMailMessage001 - success</body></html>&quot;;
SmtpMail.Send(myMail);

actually, what i really want to do is send the contents of a listbox as a email to somebody.

appreciate your help.

thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top