diff options
-rwxr-xr-x | README.md | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,6 +1,8 @@ ##Breaking API changes in 3.0.0! -Use `new SendGridMessage()` instead of `SendGrid.GetInstance()` +Use `new SendGridMessage()` instead of `SendGrid.GetInstance()` + +and `new Web()` instead of `Web.GetInstance()` #Requirements @@ -73,7 +75,7 @@ To send an email message, use the **Deliver** method on the **Web** transport cl ```csharp // Create the email object first, then add the properties. -SendGrid myMessage = new SendGridMessage(); +SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo("anna@example.com"); myMessage.From = new MailAddress("john@example.com", "John Smith"); myMessage.Subject = "Testing the SendGrid Library"; @@ -83,7 +85,7 @@ myMessage.Text = "Hello World!"; var credentials = new NetworkCredential("username", "password"); // Create an Web transport for sending email. -var transportWeb = Web.GetInstance(credentials); +var transportWeb = new Web(credentials); // Send the email. transportWeb.Deliver(myMessage); @@ -97,7 +99,7 @@ task. Attachments can be added to a message by calling the **AddAttachment** method and specifying the name and path of the file you want to attach, or by passing a stream. You can include multiple attachments by calling this method once for each file you wish to attach. The following example demonstrates adding an attachment to a message: ```csharp -SendGrid myMessage = New SendGridMessage(); +SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo("anna@example.com"); myMessage.From = new MailAddress("john@example.com", "John Smith"); myMessage.Subject = "Testing the SendGrid Library"; @@ -109,7 +111,7 @@ myMessage.AddAttachment(@"C:\file1.txt"); You can also add attachments from the data's **Stream**. It can be done by calling the same method as above, **AddAttachment**, but by passing in the Stream of the data, and the filename you want it to show as in the message. ```csharp -SendGrid myMessage = New SendGridMessage(); +SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo("anna@example.com"); myMessage.From = new MailAddress("john@example.com", "John Smith"); myMessage.Subject = "Testing the SendGrid Library"; @@ -132,7 +134,7 @@ The following examples demonstrate the footer and click tracking filters: ##Footer ```csharp // Create the email object first, then add the properties. -SendGrid myMessage = New SendGridMessage(); +SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo("anna@example.com"); myMessage.From = new MailAddress("john@example.com", "John Smith"); myMessage.Subject = "Testing the SendGrid Library"; @@ -145,7 +147,7 @@ myMessage.EnableFooter("PLAIN TEXT FOOTER", "<p><em>HTML FOOTER</em></p>"); ##Click tracking ```csharp // Create the email object first, then add the properties. -SendGrid myMessage = New SendGridMessage(); +SendGridMessage myMessage = new SendGridMessage(); myMessage.AddTo("anna@example.com"); myMessage.From = new MailAddress("john@example.com", "John Smith"); myMessage.Subject = "Testing the SendGrid Library"; |