try { MailAddress mailfrom = new MailAddress("sankarreddyece@gmail.com"); MailAddress mailto = new MailAddress(TextBox3.Text); MailMessage newmsg = new MailMessage(mailfrom, mailto); newmsg.Subject = "Subject of Email"; newmsg.Body = "Body(message) of email"; ////For File Attachment, more file can also be attached //Attachment att = new Attachment ( "G:\\code.txt" ); //newmsg.Attachments.Add ( att ); SmtpClient smtps = new SmtpClient("smtp.gmail.com", 587); smtps.UseDefaultCredentials = false; smtps.Credentials = new System.Net.NetworkCredential("sankarreddyece@gmail.com", "640"); smtps.EnableSsl = true; smtps.Send(newmsg); //MessageBox.Show("mail Send"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)