In order to do so we need to do following steps.
add below name space in your aspx.cs file
using System.Net.Mail;mail sending function in .cs file.
public void sendmail() { MailMessage Message = new MailMessage("abc@test.com", "abcd@test.com"); Message.CC.Add("abc@test.com"); Message.Bcc.Add("test@test.com"); Message.IsBodyHtml = true; Message.Subject = "Email Subject will goes here"; Message.Body = "Mail body will goes here"; SmtpClient S1 = new SmtpClient(); try { S1.Send(Message); } catch (Exception Exp) { throw Exp; } }code for web.config file in Configuration section
No comments:
Post a Comment