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); }
public void SendText() { EmailMessage message = new EmailMessage("somemessage"); message.Sender = new EmailAgent("*****@*****.**", "somename"); message.Subject = "somesubject"; message.IsBodyHtml = false; message.Message = "sometext"; 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); }
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); }