Ejemplo n.º 1
0
        public void ScheduleMulti()
        {
            var client = new SendGridClient(Environment.GetEnvironmentVariable("ApiKey"));

            var sendAt = DateTimeOffset.Now.AddMinutes(15);

            for (var i = 0; i < 5; i++)
            {
                var message = new SendGridMessage();

                message.To.Add(Environment.GetEnvironmentVariable("MailTo"));
                message.From = Environment.GetEnvironmentVariable("MailFrom");

                message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
                message.Header.AddSendAt(sendAt);

                message.Subject = "-name- さんへ" + i;
                message.Text    = "-name- さん";
                message.Html    = "<p>-name- さん</p>";

                client.Send(message);

                Thread.Sleep(200);
            }
        }
Ejemplo n.º 2
0
        public void Attachment()
        {
            var client = new SendGridClient(Environment.GetEnvironmentVariable("ApiKey"));

            var message = new SendGridMessage();

            message.To.Add(Environment.GetEnvironmentVariable("MailTo"));
            message.From = Environment.GetEnvironmentVariable("MailFrom");

            message.Subject = "file attachment";
            message.Text    = "file attachment test";

            message.AddAttachment(Environment.GetEnvironmentVariable("AttachmentImage"));

            client.Send(message);
        }
Ejemplo n.º 3
0
        public void EmbedImage()
        {
            var client = new SendGridClient(Environment.GetEnvironmentVariable("ApiKey"));

            var message = new SendGridMessage();

            message.To.Add(Environment.GetEnvironmentVariable("MailTo"));
            message.From = Environment.GetEnvironmentVariable("MailFrom");

            message.Subject = "file attachment";
            message.Html    = "file attachment test<br /><img src=\"cid:hogehoge\" /><br />inline image";

            message.AddAttachment(Environment.GetEnvironmentVariable("AttachmentImage"), "maki.jpg");
            message.Content.Add("maki.jpg", "hogehoge");

            client.Send(message);
        }
Ejemplo n.º 4
0
        public void Schedule()
        {
            var client = new SendGridClient(ConfigurationManager.AppSettings["ApiKey"]);

            var message = new SendGridMessage();

            message.To.Add(ConfigurationManager.AppSettings["MailTo"]);
            message.From = ConfigurationManager.AppSettings["MailFrom"];

            message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
            message.Header.AddSendAt(DateTimeOffset.Now.AddSeconds(30));

            message.Subject = "-name- さんへ";
            message.Text = "-name- さん";
            message.Html = "<p>-name- さん</p>";

            client.Send(message);
        }
Ejemplo n.º 5
0
        public void Send()
        {
            var client = new SendGridClient(ConfigurationManager.AppSettings["ApiKey"]);

            var message = new SendGridMessage();

            message.To.Add(ConfigurationManager.AppSettings["MailTo"]);
            message.From = ConfigurationManager.AppSettings["MailFrom"];

            message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
            message.UseFooter("html", "text");

            message.Subject = "-name- さんへ";
            message.Text = "-name- さん";
            message.Html = "<p>-name- さん</p>";

            client.Send(message);
        }
Ejemplo n.º 6
0
        public void Schedule()
        {
            var client = new SendGridClient(Environment.GetEnvironmentVariable("ApiKey"));

            var message = new SendGridMessage();

            message.To.Add(Environment.GetEnvironmentVariable("MailTo"));
            message.From = Environment.GetEnvironmentVariable("MailFrom");

            message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
            message.Header.AddSendAt(DateTimeOffset.Now.AddSeconds(30));

            message.Subject = "-name- さんへ";
            message.Text    = "-name- さん";
            message.Html    = "<p>-name- さん</p>";

            client.Send(message);
        }
Ejemplo n.º 7
0
        public void Send()
        {
            var client = new SendGridClient(Environment.GetEnvironmentVariable("ApiKey"));

            var message = new SendGridMessage();

            message.To.Add(Environment.GetEnvironmentVariable("MailTo"));
            message.From = Environment.GetEnvironmentVariable("MailFrom");

            message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
            message.UseFooter("html", "text");

            message.Subject = "-name- さんへ";
            message.Text    = "-name- さん";
            message.Html    = "<p>-name- さん</p>";

            client.Send(message);
        }
Ejemplo n.º 8
0
        public void TemplateEngine()
        {
            var client = new SendGridClient(Environment.GetEnvironmentVariable("ApiKey"));

            var message = new SendGridMessage();

            message.To.Add(Environment.GetEnvironmentVariable("MailTo"));
            message.From = Environment.GetEnvironmentVariable("MailFrom");

            message.Subject = " ";
            message.Text    = " ";

            message.UseTemplateEngine("91ba5fd7-984c-4810-95fd-030be7242106");

            message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
            message.Header.AddSubstitution("-url-", "http://buchizo.wordpress.com/");

            client.Send(message);
        }
Ejemplo n.º 9
0
        public void ScheduleMulti()
        {
            var client = new SendGridClient(ConfigurationManager.AppSettings["ApiKey"]);

            var sendAt = DateTimeOffset.Now.AddMinutes(15);

            for (int i = 0; i < 5; i++)
            {
                var message = new SendGridMessage();

                message.To.Add(ConfigurationManager.AppSettings["MailTo"]);
                message.From = ConfigurationManager.AppSettings["MailFrom"];

                message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
                message.Header.AddSendAt(sendAt);

                message.Subject = "-name- さんへ" + i;
                message.Text = "-name- さん";
                message.Html = "<p>-name- さん</p>";

                client.Send(message);

                Thread.Sleep(200);
            }
        }
Ejemplo n.º 10
0
        public void TemplateEngine()
        {
            var client = new SendGridClient(ConfigurationManager.AppSettings["ApiKey"]);

            var message = new SendGridMessage();

            message.To.Add(ConfigurationManager.AppSettings["MailTo"]);
            message.From = ConfigurationManager.AppSettings["MailFrom"];

            message.Subject = " ";
            message.Text = " ";

            message.UseTemplateEngine("91ba5fd7-984c-4810-95fd-030be7242106");

            message.Header.AddSubstitution("-name-", "抱かれたい男 No.1");
            message.Header.AddSubstitution("-url-", "http://buchizo.wordpress.com/");

            client.Send(message);
        }
Ejemplo n.º 11
0
        public void EmbedImage()
        {
            var client = new SendGridClient(ConfigurationManager.AppSettings["ApiKey"]);

            var message = new SendGridMessage();

            message.To.Add(ConfigurationManager.AppSettings["MailTo"]);
            message.From = ConfigurationManager.AppSettings["MailFrom"];

            message.Subject = "file attachment";
            message.Html = "file attachment test<br /><img src=\"cid:hogehoge\" /><br />inline image";

            message.AddAttachment(ConfigurationManager.AppSettings["AttachmentImage"], "maki.jpg");
            message.Content.Add("maki.jpg", "hogehoge");

            client.Send(message);
        }
Ejemplo n.º 12
0
        public void Attachment()
        {
            var client = new SendGridClient(ConfigurationManager.AppSettings["ApiKey"]);

            var message = new SendGridMessage();

            message.To.Add(ConfigurationManager.AppSettings["MailTo"]);
            message.From = ConfigurationManager.AppSettings["MailFrom"];

            message.Subject = "file attachment";
            message.Text = "file attachment test";

            message.AddAttachment(ConfigurationManager.AppSettings["AttachmentImage"]);

            client.Send(message);
        }