Please help that How I will get text Box message in my email id address in Asp.net ?

Status
Not open for further replies.

SACHIN123

Active Member
33
2014
1
0
Hi friends ,
I need your help . I want to know how to get Text box message in my email id . I have made Contact page on Asp.net and there I had created three text boxes .
First Text box I created for entering Name and I gave Id Tb1
Second text box I created for entering Email address and I gave id Email
Third text box I created for entering Message and I gave id Message .
Here are source page :
<asp:TextBox ID="Tb1" runat="server" Width="250px" Height="25px" Text="" placeholder="Enter your Name "
Font-Bold="True" BorderStyle="Groove" ></asp:TextBox>
<asp:TextBox ID="Email" runat="server" Width="250px" Height="25px" Text="" placeholder="Enter your Email Id "
Font-Bold="True" BorderStyle="Groove"></asp:TextBox>
<asp:TextBox ID="Message" runat="server" TextMode="MultiLine" Font-Bold="True" Text="" placeholder="Enter your Message "
BorderStyle="Groove" Height="100px" Width="250px"></asp:TextBox>
and I have created Submit button and on submit button event I have done coding for inserting above information ( Name , Email , Message ) in Database Table by name Contact and Information is inserting very fine No problem . Here are coding :

SqlConnection con = new SqlConnection(@"Data Source=USER-PC\SQLEXPRESS;Initial Catalog=Money Making Channel;Integrated Security=True");
con.Open();


String A = Tb1.Text;
String B = Email.Text;
String C = Message.Text;
string query = "insert into Contact values('" + A + "', '" + B + "','" + C + "')";
SqlCommand cmd = new SqlCommand(query, con);
cmd.ExecuteNonQuery();

con.Close();

Tb1.Text = "";
Email.Text = "";
Message.Text = "";
inform.Visible = true;
Now suppose my email id is Sachin2708agarwal@gmail.com and I want that I will get Message in my email address so what coding I need to add please give me solution . Please use above coding and edit and give me final coding which will work fine for me .
I will be very glad to you all .
Thanks
Sachin Agarwal.
 
1 comment
Status
Not open for further replies.
Back
Top