Sending online form to my email address...
Context: Aspx page using C#
I have a form. I have validation. I just need to figure out how to write the code to send the form to MY email instead of an address the client types into an input box (txtTo).
Here's the code I have:
MailAddress objMail_fromaddress = new MailAddress(txtFrom.Text);
MailAddress objMail_toaddress = new MailAddress(txtTo.Text);
objMail.From = objMail_fromaddress;
objMail.To.Add(objMail_toaddress);
Can anyone help??
NathanPosted Jul 25, 2007, 8:46 PM
Here's the code I have: MailAddress objMail_fromaddress = new MailAddress(txtFrom.Text); MailAddress objMail_toaddress = new MailAddress(txtTo.Text); objMail.From = objMail_fromaddress; objMail.To.Add(objMail_toaddress); Can anyone help??
I may be misunderstanding you, but I think you answered your own question with your intro.
Simply replace the line:
'MailAddress objMail_toaddress = new MailAddress(txtTo.Text);' with
'MailAddress objMail_toaddress = new MailAddress("[email protected]");'
obviously if your not using the txtTo box anymore you would want to remove it from your display aswell :)
Hope that helps!