IEmailSender.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Net.Mail;
  2. using System.Threading.Tasks;
  3. namespace Abp.Net.Mail
  4. {
  5. /// <summary>
  6. /// This service can be used simply sending emails.
  7. /// </summary>
  8. public interface IEmailSender
  9. {
  10. /// <summary>
  11. /// Sends an email.
  12. /// </summary>
  13. Task SendAsync(string to, string subject, string body, bool isBodyHtml = true);
  14. /// <summary>
  15. /// Sends an email.
  16. /// </summary>
  17. void Send(string to, string subject, string body, bool isBodyHtml = true);
  18. /// <summary>
  19. /// Sends an email.
  20. /// </summary>
  21. Task SendAsync(string from, string to, string subject, string body, bool isBodyHtml = true);
  22. /// <summary>
  23. /// Sends an email.
  24. /// </summary>
  25. void Send(string from, string to, string subject, string body, bool isBodyHtml = true);
  26. /// <summary>
  27. /// Sends an email.
  28. /// </summary>
  29. /// <param name="mail">Mail to be sent</param>
  30. /// <param name="normalize">
  31. /// Should normalize email?
  32. /// If true, it sets sender address/name if it's not set before and makes mail encoding UTF-8.
  33. /// </param>
  34. void Send(MailMessage mail, bool normalize = true);
  35. /// <summary>
  36. /// Sends an email.
  37. /// </summary>
  38. /// <param name="mail">Mail to be sent</param>
  39. /// <param name="normalize">
  40. /// Should normalize email?
  41. /// If true, it sets sender address/name if it's not set before and makes mail encoding UTF-8.
  42. /// </param>
  43. Task SendAsync(MailMessage mail, bool normalize = true);
  44. }
  45. }