Last active
December 16, 2015 01:39
-
-
Save timstephenson/5356742 to your computer and use it in GitHub Desktop.
Example of how we would change Watchdog to use SendGrid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Each worker currently uses Net.Mail.SmtpClient to drop the message into the IIS outgoing mail directory. | |
' For SendGrid we would change the code below as follows: | |
If oSmtpClient Is Nothing Then | |
oSmtpClient = New System.Net.Mail.SmtpClient | |
oSmtpClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis | |
End If | |
oSmtpClient.Send(oEmail) | |
' With SendGrid this would become: | |
If oSmtpClient Is Nothing Then | |
oSmtpClient = New System.Net.Mail.SmtpClient | |
oSmtpClient.Host = "smtp.sendgrid.net" | |
oSmtpClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network | |
oSmtpClient.UseDefaultCredentials = false | |
oSmtpClient.Port = 25 | |
oSmtpClient.Credentials = new System.Net.NetworkCredential("[email protected]", "password") | |
End If | |
oSmtpClient.Send(oEmail) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment