Exemple #1
0
        public void CtorStringOptionMissingRequired()
        {
            Dictionary <string, string> options = new Dictionary <string, string>();

            options["someoption"] = "someoptionvalue";
            SmtpMessenger messenger = new SmtpMessenger("somename", options);
        }
Exemple #2
0
        public void CtorNullOptions()
        {
            Dictionary <string, string> options = new Dictionary <string, string>();

            options["someoption"] = "someoptionvalue";
            SmtpMessenger messenger = new SmtpMessenger(null, null);
        }
Exemple #3
0
        static void SendHtml()
        {
            EmailMessage message = new EmailMessage("somemessage");

            message.Sender     = new EmailAgent("*****@*****.**", "Comunicacao Acao");
            message.Subject    = "Pesquisa Perfil";
            message.IsBodyHtml = true;
            message.Message    =
                @"<html>
	<head>
		<title>Pesquisa Perfil Acao</title>
	</head>
	<body>
		<a href=""$link$"">
			<img alt=""Pesquisa Perfil Acao"" src=""http://192.168.203.8:8080/images/pesquisa_adm.jpg""/>
		</a>
	</body>
</html>";
            message.AddRecipient(new EmailAgent("*****@*****.**", "Comunicacao"));

            Dictionary <string, string> options = new Dictionary <string, string>();

            options["smtp-host"] = "smtp.acao.net.br";
            options["smtp-port"] = "25";
            SmtpMessenger   messenger = new SmtpMessenger("somename", options);
            ResponseMessage response  = messenger.Send(message);
        }
Exemple #4
0
        public void SendNoEmailMessage()
        {
            Dictionary <string, string> options = new Dictionary <string, string>();

            options["smtp-host"] = "smtp.acao.net.br";
            options["smtp-port"] = "25";
            SmtpMessenger   messenger = new SmtpMessenger("somename", options);
            ResponseMessage response  = ((IMessenger)messenger).Send(new ResponseMessage("somemessage", ResponseMessageType.ErrorMessage));
        }
Exemple #5
0
        public void SendNullMessage()
        {
            Dictionary <string, string> options = new Dictionary <string, string>();

            options["smtp-host"] = "smtp.acao.net.br";
            options["smtp-port"] = "25";
            SmtpMessenger   messenger = new SmtpMessenger("somename", options);
            ResponseMessage response  = messenger.Send(null);
        }
Exemple #6
0
        public void CtorStringOptions()
        {
            Dictionary <string, string> options = new Dictionary <string, string>();

            options["smtp-host"] = "smtp.nohros.com";
            options["smtp-port"] = "25";
            SmtpMessenger messenger = new SmtpMessenger("somename", options);

            Assert.Pass();
        }
Exemple #7
0
        public void SendTextAsHtml()
        {
            EmailMessage message = new EmailMessage("somemessage");

            message.Sender     = new EmailAgent("*****@*****.**", "somename");
            message.Subject    = "somesubject";
            message.IsBodyHtml = false;
            message.Message    = "<html><title>Text as HTML</title><body>sometext</body></html>";
            message.AddRecipient(new EmailAgent("*****@*****.**", "Neylor Ohmaly"));

            Dictionary <string, string> options = new Dictionary <string, string>();

            options["smtp-host"] = "smtp.acao.net.br";
            options["smtp-port"] = "25";
            SmtpMessenger   messenger = new SmtpMessenger("somename", options);
            ResponseMessage response  = messenger.Send(message);

            Assert.AreEqual(ResponseMessageType.ProcessedMessage, response.Type);
        }
Exemple #8
0
        public void CtorStringNull()
        {
            SmtpMessenger messenger = new SmtpMessenger("somename", null);

            Assert.Pass();
        }