MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com", 587);
mail.From = new System.Net.Mail.MailAddress(sendFrom);
mail.To.Add(sendTo);
mail.Subject = "Test";
using (StreamReader reader = File.OpenText("D:\\report.html"))
{
mail.Body = reader.ReadToEnd();
}
mail.IsBodyHtml = true;
//mail.BodyEncoding = Encoding.UTF8;
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential(sendFrom, pwd;
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
MessageBox.Show("Message Sent");
This was my code. And I'm getting partial html file as the body of the mail. I need Complete file as the body of the mail. Kindly Rply.
Thanks