示例#1
0
 public void SendMailWithTemplateTest()
 {
     SendMailService.SendMailWithTemplate(
         tos: new List <string> {
         "*****@*****.**"
     },
         subject: "Subject",
         body: "Body",
         map: new Dictionary <string, object>
     {
         { "name", "テスト" },
         { "message", "こんにちは" }
     }).Wait();
 }
示例#2
0
 public void SendMailWithTemplateTest4()
 {
     SendMailService.SendMailWithTemplate(
         format: SendMailService.Format.Plane,
         tos: new List <string> {
         "*****@*****.**"
     },
         subject: "Subject",
         body: "Body",
         map: new Dictionary <string, object>
     {
         { "name", "テスト" },
         { "message", "プレーンメールのみ送りました" }
     }).Wait();
 }
示例#3
0
        public void SendMailWithTemplateTest2()
        {
            try
            {
                SendMailService.SendMailWithTemplate(
                    tos: new List <string> {
                    "*****@*****.**"
                },
                    subject: "Subject",
                    body: "Body2",
                    map: new Dictionary <string, object>
                {
                    { "name", "テスト" },
                    { "message", "こんにちは" }
                }).Wait();
            }
            catch (Exception e)
            {
                Assert.AreEqual("Web.config(またはApp.config)に key: Body2 を指定してください。", e.InnerException.Message);
                return;
            }

            Assert.Fail();
        }