Пример #1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="state"></param>
 /// <param name="command"></param>
 /// <param name="invalidMailAddressList"></param>
 public SendMailResult(SendMailResultState state, SendMailCommand command, String message, IEnumerable<MailAddress> invalidMailAddressList)
 {
     this.Command = command;
     this.State = state;
     this.Message = message;
     this.InvalidMailAddressList.AddRange(invalidMailAddressList);
 }
		public void the_from_part_should_include_display_name()
		{
			var cmd = new SendMailCommand(
				new MailgunClient("domain", "api"), 
				new MailMessage(
					new MailAddress("*****@*****.**", "Gino Heyman"),
					new MailAddress("*****@*****.**", "Gino Heyman")) 
					{ Body = "this is a test message from mailgun.", Subject = "Hello from mailgun" });

			Assert.AreEqual("\"Gino Heyman\" <*****@*****.**>", ((SimpleFormPart)cmd.CreateFormParts().First(p => p is SimpleFormPart)).Value);
		}
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="state"></param>
 /// <param name="command"></param>
 public SendMailResult(SendMailResultState state, SendMailCommand command)
 {
     this.Command = command;
     this.State = state;
     this.Message = "";
 }
Пример #4
0
 /// メールを送信し、送信結果となるSendMailListResultを取得します。
 /// <summary>
 /// メールを送信し、送信結果となるSendMailListResultを取得します。
 /// </summary>
 /// <param name="command"></param>
 /// <returns></returns>
 public SendMailResult SendMail(SendMailCommand command)
 {
     var l = this.SendMailList(new[] { command });
     if (l.Results.Count == 1)
     {
         return new SendMailResult(l.Results[0].State, command);
     }
     return new SendMailResult(l.State, command);
 }