summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example/Program.cs
blob: c1815b72a5a304208d82855409e0cf9095cf2ef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Text;
using SendGridMail;
using SendGridMail.Transport;

namespace Example
{
    class Program
    {
        // this code is used for the SMTPAPI examples
        static void Main(string[] args)
        {
            var username = "sgrid_username";
            var password = "sgrid_password";
            var from = "cj.buchmann@sendgrid.com";
            var to = new List<String>
                         {
                             "cj.buchmann@sendgrid.com"
                         };

            //initialize the SMTPAPI example class
            var smtpapi = new SMTPAPI(username, password, from, to);
            var restapi = new RESTAPI(username, password, from, to);

            //use this section to test out our REST and SMTP examples!
            restapi.EnableTemplateEmail();

            Console.WriteLine("Done!");
            Console.ReadLine();
        }
    }
}