If you dont have any SMTP server then u cant send mails thats why I choosed to use google's smtp server.

I am using it as smtp.gmail.com for sending mails.

code look like:

 MailMessage mm = new MailMessage();
mm.From = new MailAddress("yourmail@gmail.com", "sharepoint");
mm.To.Add(new MailAddress("mail@gmail.com"));
mm.subject="subject";
mm.Body = "Body";
SmtpClient sc = new SmtpClient("smtp.gmail.com");
sc.Credentials = new System.Net.NetworkCredential("yourmail@gmail.com", "yourpassword");
sc.EnableSsl = true;
sc.Send(mm);
posted on 2011-05-05 16:16  lucky.dai  阅读(334)  评论(0)    收藏  举报