Asynchronously sending Emails in C#?

后端 未结 10 1405
礼貌的吻别
礼貌的吻别 2020-11-28 23:43

I\'m developing an application where a user clicks/presses enter on a certain button in a window, the application does some checks and determines whether to send out a coupl

10条回答
  •  离开以前
    2020-11-29 00:20

    Try this:

    var client = new System.Net.Mail.SmtpClient("smtp.server");
    var message = new System.Net.Mail.MailMessage() { /* provide its properties */ };
    client.SendAsync(message, null);
    

提交回复
热议问题