Wednesday, April 23, 2014

ASP.NET MVC Mail Sending with attachment file

You can send mail with attach file using the code

 MailMessage mail = new MailMessage();  
       SmtpClient SmtpServer = new SmtpClient("");  
       mail.From = new MailAddress("");  
       mail.Subject = "Test";  
       mail.Body = "Hi";  
       System.Net.Mail.Attachment attachment;  
       attachment = new System.Net.Mail.Attachment("D:\\ff.pdf");  
       SmtpServer.Port = 587;  
       SmtpServer.Credentials = new System.Net.NetworkCredential("", "password");  
       SmtpServer.EnableSsl = true;  
       SmtpServer.Timeout = 60000;  

vfpoledeb.1 provider is not registered on the local machine

Have u Install VFP Ole DB Provider in your System ? If No then Please Install it from following link.