From the course: ASP.NET Core: Communication Management
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Send an attachment using SendGrid - ASP.NET Core Tutorial
From the course: ASP.NET Core: Communication Management
Send an attachment using SendGrid
- [Instructor] It's a common practice to attach either a file, or a document in general, when you send an email. But how can we attach a document to an email sent via SendGrid? Well, let's go to Visual Studio and see it in action. In here, go to solution explorer then go to data, view models, and ComposeEmailVM. VM stands for view model. In here, we are going to add a new property that we are going to use for the file upload. So, public, IFormFile, and the name is going to be attachment, then get and set. So let us import the IFormFile. And the reference, or the namespace, is the Microsoft.AspNetCore.Http. Let us save the changes. Now let us go to the view. So solution explorer, then go to views, home, and Compose dot C sharp HTML. In here, scroll down. Just before the submit button, we are going add a new form group. So I'll just copy these lines and paste them in here. Remove the label and the text area,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Set up a SendGrid account6m 39s
-
(Locked)
Set up a SendGrid development environment10m 53s
-
(Locked)
Send an email to a single receipt using SendGrid7m 22s
-
(Locked)
Challenge: Send an email to multiple receipts using SendGrid57s
-
(Locked)
Solution: Send an email to multiple receipts using SendGrid5m 30s
-
(Locked)
Send an attachment using SendGrid7m 59s
-
-
-