using MailKit.Net.Smtp;
using MimeKit;

namespace EmailProvider {
  public class SMTPService : IDisposable {

    private readonly SmtpClient _client;

    public SMTPService() {
      _client = new SmtpClient();
    }

    public void Send(byte[] message) {
      using var ms = new MemoryStream(message);
      var mimeMessage = new MimeMessage(ms);

      _client.Send(mimeMessage);
    }

    public void Dispose() {
      _client.Dispose();
    }
  }
}
