Firstly add a namespace in the code:
using System.Web.Mail;Now add this code into your button click event:SmtpMail.SmtpServer = SMTP SERVER NAME
var msg = new MailMessage();
msg.From = NAME WHO WILL SEND THE MAIL;
msg.To = NAME TO WHOM THE MAIL IS TO BE SEND
msg.Subject = SUBJECT OF THE MAIL
msg.Body = BODY OF THE MAIL
msg.Attachments.Add(new MailAttachment(ATTACHMENT PATH));
try
{
SmtpMail.Send(msg);
MessageBox.Show(@"Mail has been send");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}