How to send Email using C#
2014-02-10 17:01
645 查看
try { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("your_email_address@gmail.com"); mail.To.Add("to_address"); mail.Subject = "Test Mail"; mail.Body = "This is for testing SMTP mail from GMAIL"; SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); MessageBox.Show("mail Send"); } catch (Exception ex) { MessageBox.Show(ex.ToString()); }
相关文章推荐
- prjSendMailInUniversity - How to send email using VB & Winsock - 邮件发送接收程序 - VB6 + Winsock
- How to Send an Email Using UTL_SMTP with Authenticated Mail Server
- How to Send an Email Using UTL_SMTP with Authenticated Mail Server
- How to send email using sqlserver
- How to Send an Email Using UTL_SMTP with Authenticated Mail Server
- How to Send an Email Using UTL_SMTP with Authenticated Mail Server. (文档 ID 885522.1)
- How to Send an Email Using UTL_SMTP with Authenticated Mail Server
- How to send mail using any email account through Foxmail ? - Foxmail 6 漏洞,如何通过 Foxmail 用任意邮件账号发送邮件?
- How to make NAnt send an email using a real account
- How to send email via vbs using cdo
- How to send raw data to a printer by using Visual C# .NET
- How to send an email from oracle workflow process using an AdHocRole?
- using System.Web.Mail to send email
- How do I authenticate to send an email
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- how to send email
- iOS Programming 101: How To Send Email in Your iPhone App
- csharp:Learn how to post JSON string to generic Handler using jQuery in ASP.Net C#.
- How to send Email asynchronously
- how to send a SIP message using OSIP stack