Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string fromemailid;
- string from_email_pwd;
- fromemailid = "myemail@gmail.com";
- from_email_pwd = "*******xyz";
- MailAddress fromaddress = new MailAddress(fromemailid);
- MailAddress toaddress = new MailAddress("example@gmail.com");
- MailMessage msg = new MailMessage(fromaddress, toaddress);
- msg.Subject = ("newdemo");
- msg.Body = ("ok ");
- msg.Priority = MailPriority.High;
- System.Net.Mail.SmtpClient mailsender = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
- System.Net.NetworkCredential mailauthantication = new System.Net.NetworkCredential(fromemailid, from_email_pwd);
- mailsender.EnableSsl = true;
- mailsender.UseDefaultCredentials = false;
- mailsender.Credentials = mailauthantication;
- mailsender.Send(msg);
- string display = "Done Check your Mail !";
- ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "sweetAlert('" + display + "','','success')", true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement