stremail = EmailAddress;
strMailSubject = "Your Branch Login";
//strMailSubject = "Your Branch Login";
strMailPass = emailbodys.BranchMail("Anil","Your Branch Name:", "Name", "Your Login Email:", "MailAddress", "Your Password:", "PWD");
utils.SendEmail(stremail, strMailSubject, strMailPass);
public static string BranchMail(string name, string Bname, string Name, string uid, string id, string password, string pwd)
{
string strBody = "
|
return strBody;
}
public const string From_email = "history@gmail.com";
public const string From_email_password = "History";
public const string Smtp_host = "smtp.gmail.com";
public const string port = "587";
public static void SendEmail(string estrto, string estrsub, string estrmsg)
{
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
mail.To.Add(estrto);
mail.From = new MailAddress(From_email);
mail.Subject = estrsub;
mail.Body = estrmsg;
mail.IsBodyHtml=true;
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = Smtp_host;
smtpClient.Credentials = new System.Net.NetworkCredential(From_email, From_email_password);
//smtpClient.Port = 587;
smtpClient.EnableSsl = true;
smtpClient.Send(mail);
}