MailMessage el = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); string na = "mail.mail@gmail.com"; el.From = new MailAddress(na); el.To.Add(na); // adding the file: System.Net.Mail.Attachment p; p = new System.Net.Mail.Attachment("...location of a file..."); ele.Attachments.Add(p); // sending: SmtpServer.Port = 587; string eleP = "mail.mail@gmail.com"; string gE = "...password..."; SmtpServer.Credentials = new System.Net.NetworkCredential(eleP, gE); SmtpServer.EnableSsl = true; SmtpServer.Send(ele);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)