예제 #1
0
        public async Task SendMail()
        {
            using (var smtpClient = new SmtpClient(SmtpHost, SmtpPort))
                smtpClient.Send("*****@*****.**", "*****@*****.**", "SendMail", "body");

            var receivedEmails = await _smtpServer.GetServerInfo();

            Assert.Equal(1, receivedEmails.MailReceived);
        }
예제 #2
0
        public async Task OneMail()
        {
            var postalOffice = new SmtpPostalOffice(SmtpHost, SmtpPort, fromAddress);

            postalOffice.Send("Pippo", "*****@*****.**");

            var serverInfo = await _smtpServer.GetServerInfo();

            Assert.Equal(1, serverInfo.MailReceived);
            var msg = serverInfo.Messages[0];

            Assert.Equal(MailInfo(name: "Pippo", to: "*****@*****.**"), msg);
        }