public void Handle(NotEnoughCreditDto notEnoughCreditDto) { _notEnoughCreditDto = notEnoughCreditDto; var emailClient = new SendEmailClient(_mailInfo.Hostname, _mailInfo.Hostport, _mailInfo.Username, _mailInfo.Password, _mailInfo.Security); var noteVeicoloSender = new NoteVeicoloSender(emailClient.ComposeMessage(_mailInfo.From), this); noteVeicoloSender.Send(_receiverString); }
public void Send(long idNota, string receiverMail, string connection) { var emailClient = new SendEmailClient(_mailInfo.Hostname, _mailInfo.Hostport, _mailInfo.Username, _mailInfo.Password, _mailInfo.Security); var messageProvider = new NoteVeicoloMessageProvider((int)idNota, Connections.Strings[connection]); var noteVeicoloSender = new NoteVeicoloSender(emailClient.ComposeMessage(_mailInfo.From, receiverMail), messageProvider); noteVeicoloSender.Send(receiverMail); }
public void TestSmtpClient() { SendEmailClient emailClient = new SendEmailClient(_hostname, _hostport, _username, _password, _security); ISenderService senderService = emailClient.ComposeMessage(_from); Mock <IMessageProvider> messageProvideMock = new Mock <IMessageProvider>(); messageProvideMock.Setup(provider => provider.GetText()).Returns("Test text"); messageProvideMock.Setup(provider => provider.GetAbstract()).Returns("Test subject"); Assert.DoesNotThrow(() => senderService.Send(messageProvideMock.Object, _to)); }