Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (SynchronizationContextSwitcher _ctxSwitcher = new SynchronizationContextSwitcher())
- {
- SmtpClient smtp1 = new SmtpClient() { Host = "" };
- using (MailMessage msg = new MailMessage() {
- From = new MailAddress(""),
- Subject = "",
- IsBodyHtml = true})
- {
- smtp.SendCompleted += (s, e) =>
- {
- if (!e.Error.Equals(null))
- {
- //...
- }
- };
- smtp.SendAsync(msg, "");
- }
- }
Add Comment
Please, Sign In to add comment