I'm doing a simple form mail in asp.net - I've figured out how to use the Visual Web Developer 2005 express edition to do the validation, but the form mail part escapes me. There is a tutorial on asp.net (the website) with video and the whole 9 yards BUT it glosses over the part I need, which is the really really basic (to everybody but me) how to set up the sendmail/cdonts/smtp part of the equation. Anybody have some simple code? I've got just 5 boneheaded text fields to email back, but I'm stumped on the basics. Here is my cry for help. HELP!
Bgirl, I am not sure if understand your question, but if you need the code to create the SMTP object, this works for me:
<script language="vb" runat="server"> sub SendEmail(sender as Object, e as EventArgs) dim mailclient as new SMTPClient("localhost") Mailclient.send(Email.text, FROM EMAIL ADDRESS,SUBJECT,Comments.text) end sub </script>
I believe the code you are looking for is: dim mailclient as new SMTPClient("localhost")
In the beginning of your ASP.NET file, you need to import the SMTP namespace using the following directive: