Hi asp.net forum,
I have a basic webform that collects a users details I need help with the code behind to do the following:
- Email the information to the website owner, copy to the user.
- Open a thankyou page once email has been sent.
Please see details below of form:
asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<form action="" method="post" name="contact" id="form1" >
<table class="style1">
<tr>
<td class="style17" rowspan="11">
</td>
<td class="style8" rowspan="11">
<asp:Image ID="Image6" runat="server" Height="250px"
ImageUrl="~/Images/contact us 2.jpg" style="text-align: center" Width="176px" />
</td>
<td class="style15">
Full Name:</td>
<td class="style4">
<asp:TextBox ID="txtName" runat="server" Width="311px"
ToolTip="Please enter your full name"></asp:TextBox>
</td>
<td class="style15" colspan="2">
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
<asp:RequiredFieldValidator ID="valName" runat="server"
ErrorMessage="Please enter your full name" ForeColor="Red"
ControlToValidate="txtName" style="text-align: center"></asp:RequiredFieldValidator>
</td>
<td class="style16" colspan="2">
</td>
</tr>
<tr>
<td class="style15">
Email:</td>
<td class="style4">
<asp:TextBox ID="txtEmail" runat="server" Width="311px"
ToolTip="PLease enter your email if you wish to be contacted by email"></asp:TextBox>
</td>
<td class="style18" rowspan="2" valign="middle">
<asp:Image ID="Image7" runat="server" Height="44px"
ImageUrl="~/Images/phone.jpg" Width="60px" />
</td>
<td rowspan="2" valign="middle" class="style19">
123456789</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style4">
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="txtEmail" ErrorMessage="Please enter correct email format"
ForeColor="Red"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="style2">
Phone Number:</td>
<td class="style4">
<asp:TextBox ID="txtPhone" runat="server" Width="311px"
ToolTip="Please enter either a mobile phone or landline"></asp:TextBox>
</td>
<td class="style15" rowspan="2" colspan="2">
</td>
</tr>
<tr>
<td class="style11">
</td>
<td class="style12">
<asp:RequiredFieldValidator ID="valPhone" runat="server"
ControlToValidate="txtPhone" ErrorMessage="Please enter contact phone number"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style2" valign="top">
Enquiry:</td>
<td class="style4" rowspan="3">
<asp:TextBox ID="txtEnquire" runat="server" Height="87px"
style="margin-left: 0px" TextMode="MultiLine" Width="310px"
ToolTip="Please let us know what your enquiry is"></asp:TextBox>
</td>
<td class="style15">
<asp:Image ID="Image8" runat="server" Height="44px"
ImageUrl="~/Images/email.jpg" Width="60px" />
</td>
<td class="style15">
ZacDec@zacdec.co.uk</td>
</tr>
<tr>
<td class="style2">
</td>
<td class="style15" colspan="2">
</td>
</tr>
<tr>
<td class="style13">
</td>
<td class="style15" colspan="2">
</td>
</tr>
<tr>
<td class="style2">
</td>
<td colspan="1">
<asp:RequiredFieldValidator ID="valEnquire" runat="server" ControlToValidate="txtEnquire"
ErrorMessage="Please enter your requirements" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
<td class="style15" colspan="2">
</td>
</tr>
<tr>
<td class="style2">
</td>
<td colspan="1" rowspan="1">
<asp:Button ID="btnSubmit" runat="server" style="margin-left: 0px"
Text="Submit" Width="101px" onclick="btnSubmit_Click"
ToolTip="Click to submit your enquiry" />
</td>
<td class="style15" colspan="2">
</td>
</tr>
</table>
</form>
Regards adrian