Add namespace
using System.Net.Mail;
code:
MailMessage myMail = new MailMessage();
SmtpClient smtpclient = new SmtpClient();
MailAddress fromadrress = new MailAddress("from mail address");
myMail.From = fromadrress;
myMail.Subject = "Your subject";
myMail.Body = "Your email Body content";
myMail.To.Add("To email address");
myMail.Attachments.Add("File path");
smtpclient.Host = "smtp.gmail.com";
smtpclient.Port = 587;
smtpclient.EnableSsl = true;
smtpclient.Credentials = new system.Net.NetworkCredential("UserId","Password");
smtpclient.Send(myMail);
I hope it will helps you.