Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 08, 2012 01:55 PM by ak666
Apr 08, 2012 12:30 AM|LINK
I'm looking to create a form which sends data to a database and emails me the details at the same time.
I would like to build the form using the VWD formview control connected to a DB. I know how to do the formview connected to the db.
Can you tell me what the best way to send the email? Should the email data from the database or the form boxes?
Also I know I will need to use System.Net.Mail.
Please supply links if you can.
I use VWD 2008 (VB).
Apr 08, 2012 12:40 AM|LINK
MailMessage msg = new MailMessage();
msg.From = new MailAddress(TextBox2 .Text);
msg.Priority = MailPriority.Normal;
msg.Body = TextBox3.Text;
msg.IsBodyHtml = true;
SmtpClient smt = new SmtpClient();
smt.Host = "mail.careersoft-technology.com";
smt.Port = 25;
smt.DeliveryMethod = SmtpDeliveryMethod.Network;
smt.Credentials = new System.Net.NetworkCredential("write username ","write password");
Label2.Text = "mail sucessfully transfer";
Apr 08, 2012 12:43 AM|LINK
Thank you for getting back to me so fast.
So you would recomend taking the data from the form and not the database?
Will this work with a formview?
Apr 08, 2012 08:59 AM|LINK
Contact form Send Email - http://www.intstrings.com/ramivemula/asp-net/ajax-html-editor-based-contact-form-inside-updatepanel-along-with-updateprogress/
Form to store user input to Database - http://www.intstrings.com/ramivemula/asp-net/simple-html-editor-based-comments-section-with-captcha-feature-along-with-database-interactivity/
Apr 08, 2012 01:55 PM|LINK
Thanks for the links, sadly they are in C# , I only know VB. I know I can convert them however not sure they are what i'm looking for.
I was hoping I could build the form and connect to a DB using a formview (as its simple to do) and find a way of sending that data to an email.