Sending html form to email using asp.net
-
Hello! I've been searching around for information on using asp.net to send an email from an html website, containing the contents of a form among other things. So far all I've found is outdated examples and tutorials that I haven't had any luck with. Unfortunately I don't know asp.net, so can anyone point me in the right direction? I'm at a loss. Thanks for any help/advice you can provide!
-
Hello! I've been searching around for information on using asp.net to send an email from an html website, containing the contents of a form among other things. So far all I've found is outdated examples and tutorials that I haven't had any luck with. Unfortunately I don't know asp.net, so can anyone point me in the right direction? I'm at a loss. Thanks for any help/advice you can provide!
-
Lodeclaw wrote:
Unfortunately I don't know asp.net, so can anyone point me in the right direction? I'm at a loss.
What server side web development platform do you have experience with?
Sadly, none. I've been learning as I go, so it's a process of bumbling through each step until I get the result I'm looking for. So far I've only been working in html, xml, and css in terms of web dev. The client I'm doing this for doesn't seem to be using much of anything server-side, so I'm trying to build this functionality from nothing.
-
Hello! I've been searching around for information on using asp.net to send an email from an html website, containing the contents of a form among other things. So far all I've found is outdated examples and tutorials that I haven't had any luck with. Unfortunately I don't know asp.net, so can anyone point me in the right direction? I'm at a loss. Thanks for any help/advice you can provide!
You can use a MailAddress object to deal with the from and to email addresses. Then construct a MailMessage object where the body is a string as either plain text or an html document. Once you have those use an SmtpClient object to fire off the email. Set the Host and Port properties on the SmtpClient object and you should be gtg. pseudo code: message = new MailMessage smtp = new SmtpClient smtp.Send(message)
Todd Smith
-
Sadly, none. I've been learning as I go, so it's a process of bumbling through each step until I get the result I'm looking for. So far I've only been working in html, xml, and css in terms of web dev. The client I'm doing this for doesn't seem to be using much of anything server-side, so I'm trying to build this functionality from nothing.
-
Well you might want to look for some decent ASP.NET tutorials. There could be some introductory articles here on CodeProject as well.