Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }