SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.Subject = "Test Mail - 1";
mail.Body = "mail with attachment";
System.Net.Mail.Attachment attachment;
attachment = new System.Net.Mail.Attachment(@"C:\Users\551386\Desktop\DataDump\Excel.xls");
mail.Attachments.Add(attachment);
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("raj@gmailcom","12345");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
when i execute the above code shows error as follows
Failure sending mail
the above error shows in below line as follows
SmtpServer.Send(mail);
please help me what is the mistake in my above code.