Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 08, 2012 01:55 PM by ak666
Member
120 Points
102 Posts
Apr 08, 2012 12:30 AM|LINK
Hi Guys,
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).
Thanks
Contributor
2948 Points
985 Posts
Apr 08, 2012 12:40 AM|LINK
MailMessage msg = new MailMessage(); msg.To.Add("tarun@careersoft-technology.com"); 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");
smt.Send(msg); Label2.Text = "mail sucessfully transfer";
Apr 08, 2012 12:43 AM|LINK
Hi There,
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?
All-Star
95403 Points
14096 Posts
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/
Thanks,
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.
ak666
Member
120 Points
102 Posts
Email Contact Form?
Apr 08, 2012 12:30 AM|LINK
Hi Guys,
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).
Thanks
tarunSaini
Contributor
2948 Points
985 Posts
Re: Email Contact Form?
Apr 08, 2012 12:40 AM|LINK
MailMessage msg = new MailMessage();
msg.To.Add("tarun@careersoft-technology.com");
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");
smt.Send(msg);
Label2.Text = "mail sucessfully transfer";
ak666
Member
120 Points
102 Posts
Re: Email Contact Form?
Apr 08, 2012 12:43 AM|LINK
Hi There,
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?
ramiramilu
All-Star
95403 Points
14096 Posts
Re: Email Contact Form?
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/
Thanks,
JumpStart
ak666
Member
120 Points
102 Posts
Re: Email Contact Form?
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.