Hi, if you want to send a mail programmatically in c#, C# is coming with "using System.Net.Mail" namespace. SmtpClient and MailMessage classes can do the work for you to explicitly send a mail configured with CC and BB and subjects settings by you.. .
For e.g;
//instance of mail message
MailMessage mail = new MailMessage();
//create instance of smtpclient
SmtpClient smtp = new SmtpClient();
smtp.EnableSsl = true;
//recipient address
mail.To.Add(new MailAddress(userid));
//Formatted mail body
mail.IsBodyHtml = true;
string st = "";
st += "<HTML><BODY>";
st += "<span style='font-family: Verdana; font-size: 9pt'>";
st += "Dear Sir/Madam,<br/><br/>";
st += "We refer to your request for reseting your login password.";
st += "Please take note of your Login Password, as you need them every time you login.<br/><br/>";
st += "<b>Email/Userid: " + userid + "</b><br/>";
st += "<b>Password: " + password + "</b><br/><br/>";
st += "Regards</br>";
st += "XYZ Team";
st += "</span><br />";
st += "</HTML></BODY>";
mail.Body = st;
//send mail via smtp client
smtp.Send(mail);
Following is the Configuration settings for SMTP client that need to be done in the APP.config:
> <system.net>
> <mailSettings> <smtp from="">
> <network host="" port="" userName="" password=""
> defaultCredentials="false" />
> </smtp> </mailSettings> </system.net>
Note: you can define these values via code as well.
Hope it helps.