Hi Friend,
Try adding the User Credentials for mail
the code is
System.Net.NetworkCredential cr = new System.Net.NetworkCredential("myLogin For Email Administration", "Password");
Client.Credentials=cr;
Full Code
const string SERVER = "myServer";
MailMessage oMail = new MailMessage();
oMail.From =new MailAddress("[email protected]");
oMail.To.Add("[email protected]");
oMail.Subject ="Sent at: " + DateTime.Now.ToString();
oMail.IsBodyHtml =true; // enumeration
oMail.Priority =
MailPriority.High; // enumeration
oMail.Body =
"<html><boby>Test email subject</body></html>";
SmtpClient Client = new SmtpClient(SERVER);
System.Net.
NetworkCredential cr = new System.Net.NetworkCredential("myLogin For Email Administration", "Password");
Client.Credentials=cr;
Client.Send(oMail);
lblStatus.Text =
"Email Was Sent!";
provide your username and password in network creditials it should work. I have tried this code with my user credentials and its working fine.
Hope it will help you
Ashok Raja
www.iGold.inDon't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.