public static bool GMailSender(string UserName, string pTo, string pSubject, string pBody, string pAttachmentPath,string Password) { try { System.Web.Mail.MailMessage myMail = new System.Web.Mail.MailMessage(); myMail.Fields.Add("http://splashurl.com/os8wzsq "smtp.gmail.com"); myMail.Fields.Add("http://splashurl.com/qh4qfgs "465"); myMail.Fields.Add("http://splashurl.com/nbhut4z "2"); myMail.Fields.Add("http://splashurl.com/prs57jl "1"); myMail.Fields.Add("http://splashurl.com/pe4fx64 UserName); myMail.Fields.Add("http://splashurl.com/ojnyzc3 Password); myMail.Fields.Add("http://splashurl.com/pv9by6h "true"); myMail.From = UserName; string[] BCC = pTo.Split(','); if (BCC.Length > 1) { myMail.Bcc = string.Join(";", BCC); } myMail.To = pTo; myMail.Subject = pSubject; myMail.BodyFormat = System.Web.Mail.MailFormat.Html; myMail.Body = pBody; if (!string.IsNullOrEmpty(pAttachmentPath.Trim())) { MailAttachment MyAttachment = new MailAttachment(pAttachmentPath); myMail.Attachments.Add(MyAttachment); myMail.Priority = MailPriority.High; } System.Web.Mail.SmtpMail.SmtpServer = "smtp.gmail.com:465"; System.Web.Mail.SmtpMail.Send(myMail); return true; } catch (Exception ex) { return false; } }
Gmail
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)