You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TROUBLESHOOTING.md
+55-43Lines changed: 55 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,17 @@ If you can't find a solution below, please open an [issue](https://github.com/se
5
5
6
6
## Table of Contents
7
7
8
-
*[Migrating from the v2 API to v3](#migrating)
9
8
*[Continue Using the v2 API](#v2)
9
+
*[Environment Variables and Your SendGrid API Key](#environment)
10
+
*[Error Messages](#error)
11
+
*[Migrating from the v2 API to v3](#migrating)
10
12
*[Migrating from the v8 SDK to v9](#sdkmigration)
13
+
*[Missing Classes](#missing)
11
14
*[Testing v3 /mail/send Calls Directly](#testing)
12
15
*[Using .NET 4.5.1 and lower](#net45)
13
-
*[Missing Classes](#missing)
14
-
*[Error Messages](#error)
15
-
*[Versions](#versions)
16
-
*[Environment Variables and Your SendGrid API Key](#environment)
17
16
*[Using the Package Manager](#package-manager)
18
-
19
-
<aname="migrating"></a>
20
-
## Migrating from the v2 API to v3
21
-
22
-
Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html) on how to migrate from v2 to v3.
17
+
*[Versioning Convention](#versioning)
18
+
*[Viewing the Request Body](#request-body)
23
19
24
20
<aname="v2"></a>
25
21
## Continue Using the v2 API
@@ -36,34 +32,20 @@ Download:
36
32
37
33
Click the "Clone or download" green button in [GitHub](https://github.com/sendgrid/sendgrid-csharp/tree/b27983a8f3d84a9d28972f2720cca0315ad9fe32) and choose download.
38
34
39
-
<aname="sdkmigration"></a>
40
-
## Migrating from the v8 SDK to v9
41
-
42
-
v9 of this SDK is a complete rewrite that includes the removal of dynamic dependencies, a new Mail Helper and support for .NET Standard 1.3.
43
-
44
-
Please begin at the [README](https://github.com/sendgrid/sendgrid-csharp) and if you need further assistance, please [create an issue on GitHub](https://github.com/sendgrid/sendgrid-csharp/issues).
45
-
46
-
<aname="net45"></a>
47
-
## Using .NET 4.5.1 and lower
48
-
49
-
[Microsoft is no longer supporting these versions](https://blogs.msdn.microsoft.com/dotnet/2015/12/09/support-ending-for-the-net-framework-4-4-5-and-4-5-1/). We strongly advise upgrading your software to target .NET 4.5.2 or higher. If you are unable to do so, the current solution is to download the code directly into your project and change the compile target to the desired version.
50
-
51
-
<aname="missing"></a>
52
-
## Missing Classes
35
+
<aname="environment"></a>
36
+
## Environment Variables and Your SendGrid API Key
53
37
54
-
If you receive one of the following errors, or something similar:
38
+
All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-csharp#setup-environment-variables) to hold your SendGrid API key.
55
39
56
-
* ‘Helpers’ does not exist in the namespace ‘SengrGrid’
57
-
* The type or namespace name ‘Mail’ could not be found
40
+
If you choose to add your SendGrid API key directly (not recommended):
58
41
59
-
it means that you are probably not compiling your application to .NET 4.5.2. Currently, this is the only supported version of .NET by SendGrid.
The current solution is to download the code directly into your project and change the compile target to the desired version.
44
+
becomes
62
45
63
-
<aname="testing"></a>
64
-
## Testing v3 /mail/send Calls Directly
46
+
`string apiKey = "SENDGRID_API_KEY";`
65
47
66
-
[Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases.
48
+
In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key.
67
49
68
50
<aname="error"></a>
69
51
## Error Messages
@@ -79,25 +61,39 @@ Console.WriteLine(response.Body.ReadAsStringAsync().Result); // The message will
79
61
Console.WriteLine(response.Headers.ToString());
80
62
```
81
63
82
-
<aname="versions"></a>
83
-
## Versions
64
+
<aname="migrating"></a>
65
+
## Migrating from the v2 API to v3
84
66
85
-
We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-csharp/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-csharp/releases) section.
67
+
Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html) on how to migrate from v2 to v3.
86
68
87
-
<aname="environment"></a>
88
-
## Environment Variables and Your SendGrid API Key
69
+
<aname="sdkmigration"></a>
70
+
## Migrating from the v8 SDK to v9
89
71
90
-
All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-csharp#setup-environment-variables) to hold your SendGrid API key.
72
+
v9 of this SDK is a complete rewrite that includes the removal of dynamic dependencies, a new Mail Helper and support for .NET Standard 1.3.
91
73
92
-
If you choose to add your SendGrid API key directly (not recommended):
74
+
Please begin at the [README](https://github.com/sendgrid/sendgrid-csharp) and if you need further assistance, please [create an issue on GitHub](https://github.com/sendgrid/sendgrid-csharp/issues).
If you receive one of the following errors, or something similar:
97
80
98
-
`string apiKey = "SENDGRID_API_KEY";`
81
+
* ‘Helpers’ does not exist in the namespace ‘SengrGrid’
82
+
* The type or namespace name ‘Mail’ could not be found
99
83
100
-
In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key.
84
+
it means that you are probably not compiling your application to .NET 4.5.2. Currently, this is the only supported version of .NET by SendGrid.
85
+
86
+
The current solution is to download the code directly into your project and change the compile target to the desired version.
87
+
88
+
<aname="testing"></a>
89
+
## Testing v3 /mail/send Calls Directly
90
+
91
+
[Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases.
92
+
93
+
<aname="net45"></a>
94
+
## Using .NET 4.5.1 and lower
95
+
96
+
[Microsoft is no longer supporting these versions](https://blogs.msdn.microsoft.com/dotnet/2015/12/09/support-ending-for-the-net-framework-4-4-5-and-4-5-1/). We strongly advise upgrading your software to target .NET 4.5.2 or higher. If you are unable to do so, the current solution is to download the code directly into your project and change the compile target to the desired version.
101
97
102
98
<aname="package-manager"></a>
103
99
## Using the Package Manager
@@ -107,3 +103,19 @@ We upload this library to [Nuget](https://www.nuget.org/packages/SendGrid) whene
107
103
In most cases we recommend you download the latest version of the library, but if you need a different version, please use:
108
104
109
105
`PM> Install-Package Sendgrid -Version X.X.X`
106
+
107
+
<aname="versioning"></a>
108
+
## Versioning Convention
109
+
110
+
We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-csharp/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-csharp/releases) section.
111
+
112
+
<aname="request-body"></a>
113
+
## Viewing the Request Body
114
+
115
+
When debugging or testing, it may be useful to exampine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
116
+
117
+
You can do this right before you call `var response = await client.SendEmailAsync(msg);` like so:
0 commit comments