Exemplo n.º 1
0
        public async Task SendAsync()
        {
            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>";

            await client.SendAsync(message);
        }
Exemplo n.º 2
0
        public async Task SendAsync()
        {
            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>";

            await client.SendAsync(message);
        }