MailMessage mail = new MailMessage();//put mail from Email mail.From = new MailAddress("MailFrom@gmail.com");//put mail to Email mail.To.Add(new MailAddress("MailTo@gmail.com"));//you can add blank carbon copy mails here//mail.Bcc.Add(new MailAddress("YOUR BCC EMAIL"));//Get an attachment in attachment variable classAttachment att = new Attachment("D:\\test.txt");//add attachment to email mail.Attachments.Add(att);//Put email subject mail.Subject = "Send Email with Gmail using ASP.NET";//Put email body string Body = "Put your Email Body TEXT here";// Here you can put HTML string if you want email to be sent in HTML format. mail.Body = Body; mail.IsBodyHtml = true;SmtpClient smtp = new SmtpClient();smtp.Credentials = new System.Net.NetworkCredential("abc@gmail.com", "PASSWORD");//keep ssl true if you have to send email with secured socket layersmtp.EnableSsl = false;smtp.Send(mail);