Skip to main content

Posts

Showing posts with the label C# code for Sending an email

C Sharp code for Sending an email

C# code for Sending an email private void send_mail() { MailMessage mm = new MailMessage("write_emailid_reciever", txtEmailId.Text); mm.Subject = "Thnaks for your Feedback."; mm.Body = "Dear Costomer Thanks for your feedback.You are more than welcome to give us a try again. Thank you."; SmtpClient sc = new SmtpClient("mailing_server", 25);//25-is smtp port number NetworkCredential nc = new NetworkCredential(); nc.UserName = "write_emailid_sender"; nc.Password = "password"; sc.Credentials = nc; sc.Send(mm); }