A Quick Tutorial on SMTP Email Sending with OAuth2 in .Net Core (Code Sample).

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
talk about how do we go about sending emails uh using SMTP using the modern or Authentication so let me go through the application uh the GitHub report that I have downloaded recently so if you see uh I have already downloaded the code uh created by David Dunn and I made few changes to this code and um push this code to my repository by asking the users for tenant Ida and the client ID okay so you'll need to enter this details in order to move forward so this app basically uh would send an email using SMTP but the authentication would be done through the modern auth okay so before we do anything and run this application we'll need to set an app on Azure ID okay so if you would like to authenticate SMTP using Postman uh we have another video on this channel uh you can check that out so for now uh you can go ahead and open Azure portal and create a new app registration so here I am on Azure active directory click on new so the new registration is there uh click on new I named the app I'll be naming simple sample SMTP okay and click on register all right so once you have these details go to the authentication tab and click on ADD platform uh make sure you add mobile and desktop application and here you need to provide the redirect URL so if you are hosting this on the local system you need to copy this localhost and paste it over here oh um I'll copy that and paste it over here click on configure it gets added over here and make sure you enable this public client flow this is important uh for the authentication to takes place and click on Save so once you save this detail goes go back to the OU section and now we are ready to run this application so if you look uh look at the application closely we we are only taking tenant ID and the client ID from the user and then you are using this uh these two details to authenticate SMTP using oauth which is a modern authentication and once we get the token for SMTP we are using that token to send an email okay so in in this particular case we would be sending email to ourselves all right so let's get started I'll click on run so this will launch the console and it will ask us for a tenant ID first of all yeah so it is asking for the tenant ID so I'll go back here and copy the tenant ID and paste it over here okay now it is asking for the client ID I'll copy the client ID as well and paste it over there it will request the access token and it will open the interactive code flow here it is asking me for uh my login details I'll login with my account and now it is giving me a consent page where it is showing me all the consent all the Scopes this app has been asking me so I'll click on accept once I accepted the authentication gets completed and I can go back to the app here I get the oauth export to token okay along with all the other details and once this is completed it says uh the mail has been successfully sent so if I go back to the app and check my email um it should be there yeah so the mail is there which has just been received okay so this was all for now for this particular video uh including sending an email using or uh SMTP uh using the model not so if you need uh the explanation to the code uh please uh do let me know and um I'll be happy to explain this code detail all right uh if you guys have any other questions uh please do let me know and um I'll be happy to help
Info
Channel: Graph Explorer
Views: 6,706
Rating: undefined out of 5
Keywords:
Id: YlkeL8i0HZQ
Channel Id: undefined
Length: 5min 18sec (318 seconds)
Published: Fri Oct 21 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.