hi Friends
i try this code but not able to get mail
please through this send me u r valuable thoughts
MailMessage mailMessage=new MailMessage();
mailMessage.From = "[email protected]";
mailMessage.To="[email protected]";
mailMessage.Cc = "[email protected]";
mailMessage.Bcc = "[email protected]";
mailMessage.Subject = "this test mail";
mailMessage.BodyFormat = MailFormat.Text;
mailMessage.Body = "sample mail";
mailMessage.Priority = MailPriority.Normal;
SmtpMail.SmtpServer = "mail.ajel.com";
SmtpMail.Send(mailMessage);
lblValidate.Visible = true;
lblValidate.Text = "successfully subscribed.";
Loading

Javeed M ShaikhPosted Oct 12, 2011, 2:26 PM
try this, it is working on my machine:
private string SendMessage(string mFrom, string mTo, string mCC, string mSubject, string mBody)
{
string RetMsg = string.Empty;
MailMessage mail = new MailMessage();
mail.From = new MailAddress(mFrom);
mail.To.Add(mTo);
mail.CC.Add(new MailAddress(cc));
mail.Subject = mSubject;
mail.Body = mBody;
SmtpClient smtp = new SmtpClient("server address");
try {
AddMsg("Sending Email now...");
smtp.Send(mail);
AddMsg("Sending Sent");
} catch (Exception ex) {
RetMsg = ex.Message;
}
return RetMsg;
}
Please do not forget to mark "Accepted Answer".
Satyapriya NayakPosted Oct 12, 2011, 2:18 PM
Refer the below link
http://www.c-sharpcorner.com/UploadFile/prathore/2464/
Thanks
VulpesPosted Oct 12, 2011, 8:43 AM
http://www.systemnetmail.com/