Skip to content

Commit e331c27

Browse files
Update README.md
1 parent f7a16c0 commit e331c27

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PM> Install-Package SendGrid.SmtpApi
2828
Add the following namespace to use the library:
2929

3030
```csharp
31-
using SendGrid.CSharp.HTTP.Client;
31+
using SendGrid.SmtpApi;
3232
```
3333

3434
Once you have the library properly referenced in your project, you can include calls to them in your code.
@@ -38,19 +38,32 @@ For a sample implementation, check the [Example](https://github.com/sendgrid/smt
3838
# Quick Start
3939

4040
```csharp
41-
using SendGrid.CSharp.HTTP.Client;
41+
using SendGrid.SmtpApi;
4242

43+
var header = new Header();
44+
45+
var uniqueArgs = new Dictionary<string,string> {
46+
{ "foo", "bar" },
47+
{ "chunky", "bacon"}
48+
};
49+
50+
header.AddUniqueArgs(uniqueArgs);
51+
52+
var xmstpapiJson = header.JsonString();
53+
```
54+
55+
```csharp
56+
SmtpClient client = new SmtpClient();
57+
client.Port = 587;
4358
client.Host = "smtp.sendgrid.net";
4459
client.Timeout = 10000;
4560
client.DeliveryMethod = SmtpDeliveryMethod.Network;
4661
client.UseDefaultCredentials = false;
47-
String sendgrid_username = Environment.GetEnvironmentVariable("SENDGRID_USERNAME", EnvironmentVariableTarget.User);
48-
String sendgrid_password = Environment.GetEnvironmentVariable("SENDGRID_PASSWORD", EnvironmentVariableTarget.User);
49-
client.Credentials = new System.Net.NetworkCredential(sendgrid_username,sendgrid_password);
62+
client.Credentials = new System.Net.NetworkCredential("your_sendgrid_username","your_sendgrid_password");
5063

5164
MailMessage mail = new MailMessage();
52-
mail.To.Add(new MailAddress("test@example.com"));
53-
mail.From = "test@example.com";
65+
mail.To.Add(new MailAddress("user@example.com"));
66+
mail.From = "you@yourcompany.com";
5467
mail.Subject = "this is a test email.";
5568
mail.Body = "this is my test email body";
5669

0 commit comments

Comments
 (0)