// [TestMethod] public void Send_Email_With_Custom_Smtp_Factory() { var model = new TestModel() { FirstName = "TestFirstName", LastName = "TestLastName", CreationDate = DateTime.Now }; var smtpClient = new MockSmtpClientFactory(); GlobalConfiguration.Configuration.SmtpClientFactory = smtpClient; var messageId = Guid.NewGuid().ToString(); var emailConfig = QMailerService.CreateEmailConfig(messageId); emailConfig.SetView("test") .AddRecipient(new EmailAddress() { Address = "*****@*****.**" }) .AddParameter("param1", "value1") .SetSender("*****@*****.**", "marc", "god", "code", true) .SetModel(model); QMailerService.SendAsync(emailConfig); Assert.AreNotEqual(0, smtpClient.CreateCount); }
public ActionResult Contact(string templateName) { string messageId = Guid.NewGuid().ToString(); var emailConfig = QMailerService.CreateEmailConfig(messageId); emailConfig.SetView(templateName) .AddRecipient(new QMailer.EmailAddress() { Address = "*****@*****.**", SendingType = EmailSendingType.To }); QMailerService.SendAsync(emailConfig); return(View()); }
public void Send_Email() { var model = new TestModel() { FirstName = "TestFirstName", LastName = "TestLastName", CreationDate = DateTime.Now }; var messageId = Guid.NewGuid().ToString(); var emailConfig = QMailerService.CreateEmailConfig(messageId); emailConfig.SetView("test") .AddRecipient(new EmailAddress() { Address = "*****@*****.**" }) .AddParameter("param1", "value1") .SetSender("*****@*****.**", "marc", "god", "code", true) .SetModel(model); QMailerService.SendAsync(emailConfig); }
public void SendAsync(EmailConfig emailConfig) { QMailerService.SendAsync(emailConfig); }