I have an aspx form and there are bunch of textboxes, drowdownlists, checkboxes. When this input controls are filled with necessary data I want to send this information as email. Let’s say I have a textbox that takes the applicant’s name, a dropdownlist that lists occupations and so foth. So I will want to have the email contain the same information, as
Name:Anthony Brian
Occupation: Surgeon
......
How would I do this?
EDIT: Here’s the aspx in case somebody is interested:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WriteMail.aspx.cs"
Inherits="WriteMail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style2
{
width: 203px;
}
.style3
{
width: 226px;
}
.style4
{
}
.style6
{
width: 198px;
}
.style7
{
width: 204px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div align="center" style="font-weight: bold; font-family: tahoma; font-size: 12px;
margin-bottom: 10px;">
Hörmətli istifadəçi!</div>
<div align="center" style="font-family: tahoma; font-size: 12px;margin-bottom:
30px;">
<span class="style2"><span class="style10">Azərbaycan Respublikası Dövlət Sosial
Müdafiə
Fonduna məktub göndərmək ücün aşağıdakı formanı doldurun.(* - vacib sahələr)
</span></span></div>
<div id="main">
<table>
<tr>
<td class="style6">
Adınız* :</td>
<td class="style7">
Soyadınız* :</td>
<td class="style3">
Atanızın adı*</td>
</tr>
<tr>
<td class="style6">
<asp:TextBox ID="TextBox2" runat="server" Width="182px"></asp:TextBox>
</td>
<td class="style7">
<asp:TextBox ID="TextBox3" runat="server" Width="182px"></asp:TextBox>
</td>
<td class="style3">
<asp:TextBox ID="TextBox4" runat="server" Width="182px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
Ölkə*: </td>
<td class="style7">
Şəhər*: </td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
<asp:TextBox ID="TextBox5" runat="server" Width="182px"></asp:TextBox>
</td>
<td class="style7">
<asp:TextBox ID="TextBox6" runat="server" Width="182px"></asp:TextBox>
</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
Ünvan*:</td>
<td class="style7">
</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style4" colspan="3">
<asp:TextBox ID="TextBox7" runat="server" Width="602px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
Telefon kodu və nömrəsi*:</td>
<td class="style7">
Email*:</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
<asp:TextBox ID="TextBox8" runat="server" Width="182px"></asp:TextBox>
</td>
<td class="style7">
<asp:TextBox ID="TextBox9" runat="server" Width="182px"></asp:TextBox>
</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
</td>
<td class="style7">
</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
Yaşınız*:</td>
<td class="style7">
Cinsiniz*:</td>
<td class="style3">
</td>
</tr>
<tr>
<td class="style6">
<asp:TextBox ID="TextBox10" runat="server" Width="66px"></asp:TextBox>
</td>
<td class="style7">
<asp:CheckBoxList ID="CheckBoxList1" runat="server"
RepeatDirection="Horizontal">
<asp:ListItem Value="1">Kişi</asp:ListItem>
<asp:ListItem Value="2">Qadın</asp:ListItem>
</asp:CheckBoxList>
</td>
<td class="style3">
</td>
</tr>
</table>
</div>
</form>
you can use below code for getting details from your aspx page and sent it as email body.
Hope this will helps you…happy coding….