Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
My asp.net page is showing data from sql database.
if user find any error in the data he can send email to admin regarding
Correction of data.
i want to add a button on the form
on click event of the button i want generate a email which can be send to admin
how can i achieve this

thanks
Posted

You might try this AnLogger - ASP.NET Logger[^]

Hope it helps :)
 
Share this answer
 
Try this:-

private void btnSend_Click(object sender, System.EventArgs e)
{                                                
    MailMessage msg = new MailMessage();
 
    msg.To = txtTo.Text;

    msg.From = txtFrom.Text;

    msg.Subject = txtSubject.Text;

    msg.Body = txtContent.Value;
    lblStatus.Text = "Sending...";
                                             
    SmtpMail.Send(msg);

    lblStatus.Text = "Sent email (" + txtSubject.Text + ") to " +txtTo.Text;                                         
}

Send Email in ASP.Net 2.0 - Feed back Form[^]

http://www.c-sharpcorner.com/UploadFile/dchoksi/SendingMail02132007002923AM/SendingMail.aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900