Image for post
Image for post

Send Emails Using SendGrid with Azure in .NET Core

Last week I’ve to work on a pet project with a colleague and we were talking about the notification emails that we are going to use in the application, automatically I thought about azure and found the perfect service for this task. SendGrid is a cloud-based email service that provides reliable transactional email delivery, scalability, and much more.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
  • The var message that runs the task to create a single Email, you have many options with SendGrid, you are free to experiment with the others available, for this tutorial purpose I’m just using this one :)
  • The last one is the response var, just commit the email that you created.
Image for post
Image for post
Note : For making this works, you also need to include your service in the startup.cs file depends on the approach you are using for the service injection. I’m using Autofac, I’ll let you the documentation link for reference.
Image for post
Image for post
Image for post
Image for post

References:

Written by

I am Microsoft MVP in the award category: Developers technologies, a professional with several years in software development specifically in .NET technology.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store