<
script runat="server">
protected string now = DateTime.Now.ToString();
public void Page_Load(object sender, EventArgs e)
{
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
System.Net.NetworkCredential cred = new System.Net.NetworkCredential("yourid@gmail.com", "yourpassword");
mail.To.Add("a@a.com");
mail.Subject = "subject goes here";
mail.From = new System.Net.Mail.MailAddress(yourid@gmail.com);
mail.IsBodyHtml = true;
mail.Body = "This message has been sent programmatically with GMail";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Credentials = cred;
smtp.Port = 587;
smtp.Send(mail);
}
</
script>
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5