Guest User

Untitled

a guest
Oct 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. private Task SendFromServer(MailMessage mailMessage, bool reuse, bool useServerSmtp)
  2. {
  3. return Task.Factory.StartNew(() =>
  4. {
  5. var smtp = new SmtpClient();
  6. smtp.Send(mailMessage);
  7. }
  8. catch (Exception ex)
  9. {
  10. Logger.Error(ex.InnerException ?? ex);
  11. }
  12. finally
  13. {
  14. if(!reuse)
  15. mailMessage.Dispose();
  16. }
  17. });
  18. }
  19. }
Add Comment
Please, Sign In to add comment