Pintoo Yadav

Pintoo Yadav

  • NA
  • 2.1k
  • 404.5k

hi am geting this error Failure sending mail. pls help me

Aug 6 2015 7:51 AM
my code is 
 
try
{
//Mail Message
MailMessage mM = new MailMessage();
mM.From = new MailAddress("[email protected]");
//receiver email id
mM.To.Add("[email protected]");
mM.Subject = "Text H2H Mail";
File.Copy("D:\\ClientMgmtDb1.accdb", "D:\\ClientMgmtDb21.accdb", true);
mM.Attachments.Add(new Attachment(@"D:\\ClientMgmtDb21.accdb"));
mM.Body = "Log_Fole";
mM.IsBodyHtml = true;
// SmtpClient sC = new SmtpClient("smtp.WorldClient.com");
SmtpClient sC = new SmtpClient("192.168.100.10");
// SmtpClient.UseDefaultCredentials = true;
sC.Port = 25;
sC.Credentials = new NetworkCredential("[email protected]", "pintoo@123");
sC.EnableSsl = false;
sC.Send(mM);
MessageBox.Show("Mail send Successfully..Thanks");
mM.Dispose();
File.Delete("D:\\ClientMgmtDb21.accdb");
}
catch (Exception ex)
{
MessageBox.Show("Error" + ex.Message.ToString());
}
 

Answers (1)