summaryrefslogtreecommitdiffstats
path: root/SendGrid/Example/Program.cs
blob: 472d5b78ebad3c70f3ba0645a82213ff2a852c8a (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
    {
        static void Main(string[] args)
        {
            var username = "cjbuchmann";
            var password = "Gadget_15";
            var from = "cj.buchmann@sendgrid.com";
            var to = new List<String>
                         {
                             "cj.buchmann@sendgrid.com"
                         };

            var bcc = new List<string>
                          {
                              "eric@sendgrid.com"
                          };            
            
            var cc = new List<string>
                          {
                              "eric@sendgrid.com"
                          };

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

            //send a simple HTML encoded email.
            //smtpapi.SimpleHTMLEmail();

            //send a simple Plaintext email.
            //smtpapi.SimplePlaintextEmail();

            //send a gravatar enabled email.
            //smtpapi.EnableGravatarEmail();

            //send an open tracking enabled email.
            //smtpapi.EnableOpenTrackingEmail();

            restpapi.SimpleHTMLEmail();
        }
    }
}