Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
Jean Paul
satyapriyanayak
Narayanan
Karthikeyan Anbarasan
JQuery Developer
Home
>>
Forum
>>
C#
>>
Post New Question
Subscribe to Forum
how to send e-mail from site to admin
Posted By:
shahin
Posted Date:
November 03, 2008
Points:
2
Category :
C#
can anyone send me code for sending mail from site ?
Responses
Author:
Rahul
Company URL:
Posted Date: November 04, 2008 Points: 5
Hi,
Refer this post for coding.
http://www.dotnetspark.com/Forum/4-how-to-send-mail-asynchronously-asp-net.aspx
Author:
krishana singh
Company URL:
http://www.projectshub.in
Posted Date: October 16, 2010 Points: 5
protected void hrfSubmit_ServerClick(object sender, EventArgs e)
{
try
{
if (con.State == ConnectionState.Open)
con.Close();
con.Open();
string insertcontact = "INSERT INTO tblContactUs(Uname,Address,Mobile,Email,Comment) VALUES('" + txtname.Text + "','" + txtadd.Text + "','" + txtmobile.Text + "','" + txtemail.Text + "','" + txtcomment.Text + "')";
SqlCommand cmd = new SqlCommand(insertcontact,con);
cmd.ExecuteNonQuery();
txtadd.Text = txtemail.Text = txtemail.Text = txtcomment.Text = txtname.Text = txtmobile.Text = "";
string bodytext = "<html>";
bodytext += "<table border='1'>";
bodytext += "<tr><td>Name: </td><td>'" + txtname.Text + "'</td></tr><br/>";
bodytext += "<tr><td>EmailID: </td><td>'" + txtemail.Text + "'</td></tr><br/>";
bodytext += "<tr><td>Mobile:</td><td>'" + txtmobile.Text + "'</td></tr><br/>";
bodytext += "<tr><td>Address:</td><td>'" + txtadd.Text + "'</td></tr><br/>";
bodytext += "<tr><td>Comment</td><td>'" + txtcomment.Text + "'</td></tr><br/>";
bodytext += "</table>";
bodytext += "</html>";
Email.SendMail(txtemail.Text, "info@theflowersworld.com", "Contact information", bodytext);
Email.SendMail("info@theflowersworld.com", txtemail.Text, "confirmation mail", "your information saved successfully ");
}
catch (Exception ex)
{
txtadd.Text = txtemail.Text = txtemail.Text = txtcomment.Text = txtname.Text = txtmobile.Text = "";
}
}
Post Reply
You must
Sign In
To post reply
Related Questions Related Questions
How to Send Mail Asynchronously in asp.net
Automatic Mail Send on Scheduled Date time in Asp.net
Send Mail Promting throw out-look
Send mail using javascript
How to identify a mail which is sent from c#.net is send, bounce and open by the receipent?
Latest Forum Questions From The Same Category
Delete Row and Select Next Record in DatagridView
How to take backup and restore of local database?
How to reduce size of PPT file generated form OpenXML
how to pass parameter
COM object that has been separated from its underlying RCW cannot be used. in C#.net
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend