项目作者: Leen15

项目描述 :
Send email with smtp on a windows store app, based on a msdn post.
高级语言: C#
项目地址: git://github.com/Leen15/WinRT-Send-Email-with-SMTP.git
创建时间: 2015-12-14T11:04:52Z
项目社区:https://github.com/Leen15/WinRT-Send-Email-with-SMTP

开源协议:

下载


WinRT-Send-Email-with-SMTP

Basic classes for send email with smtp, based on a msdn post (http://blogs.msdn.com/b/mim/archive/2013/11/29/sending-an-email-within-a-windows-8-1-application-using-streamsocket-to-emulate-a-smtpclient.aspx).

With these classes you can easly send an email with smtp protocol.

Here is a simple code for how to do it:

  1. var client = new SmtpClient()
  2. {
  3. Server = "smtp.yandex.com",
  4. Port = 465,
  5. IsSsl = true,
  6. UserName = your_username,
  7. Password = your_password
  8. };
  9. var message = new SmtpMessage()
  10. {
  11. From = from_address,
  12. FromName = from_name,
  13. ReplyTo = reply_address,
  14. ReplyToName = reply_name,
  15. Subject = subject,
  16. Body = body
  17. };
  18. message.AddTo(recipient);
  19. await client.SendMail(message);