private void SendMailWithSmtpGmail() { MailMessage mail = new MailMessage(); NetworkCredential cred = new NetworkCredential("your gmail account", "your password"); mail.To.Add("whatever@something"); mail.Subject = "Some text"; mail.From = new System.Net.Mail.MailAddress("whatever@something"); mail.Body = "Send @ " + DateTime.Now.ToString(); SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.UseDefaultCredentials = false; smtp.EnableSsl = true; smtp.Credentials = cred; smtp.Port = 587; smtp.Send(mail); } |
Saturday, April 25, 2009
SendMail whit smtp.gmail.com
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment