Send Email with a .NET 6 Web API using Mailkit & SMTP 📧

  Рет қаралды 76,473

Patrick God

Patrick God

Күн бұрын

Пікірлер: 117
@PatrickGod
@PatrickGod Жыл бұрын
🚀 Join the .NET Web Academy with a 30% discount - closing soon! 👉 www.dotnetwebacademy.com/courses/academy?coupon=dnwas23yt
@Thorne991
@Thorne991 9 ай бұрын
Great Job! This is the real one for Email Clients.
@bzmind_
@bzmind_ 2 жыл бұрын
Thanks for also showing the best practice to implement this, like creating IEmailService, DTO etc... that is much more helpful than you think!!! Thanks.
@shahabjoon201
@shahabjoon201 2 жыл бұрын
Perfect as always Mr. God. You bless You.
@PatrickGod
@PatrickGod 2 жыл бұрын
😅 Thank you!
@jnr.guerreiro
@jnr.guerreiro 2 жыл бұрын
😂
@enhu
@enhu 2 жыл бұрын
oh my god I was literally looking for this 2 days ago, you're a life savior, god bless you!
@PatrickGod
@PatrickGod 2 жыл бұрын
Glad I could help! Thanks for sharing that. 😁
@has_ali
@has_ali 2 жыл бұрын
Lol @ OMG & Life savior puns
@luciopereirabrito3154
@luciopereirabrito3154 Жыл бұрын
Thank you a lot, I'm from Brazil and you helped me with this subject. I was having problems with the TSL server. However, now everything makes sense.
@tahirnawaz9821
@tahirnawaz9821 11 ай бұрын
Thank you so much ❤, seriously I have no words for you, God bless you
@nueledem3525
@nueledem3525 Жыл бұрын
Nice one patrick. Great video!
@PatrickGod
@PatrickGod Жыл бұрын
Thank you! 😊
@nirajchandrajoshi
@nirajchandrajoshi 11 ай бұрын
Hi I am new to your video and just to highlight that your way of talking is more than super actually supeeeeeeeeeeeeer.
@GrimReaper160490
@GrimReaper160490 2 жыл бұрын
This is great Patrick! Very simple tutorial but is very useful in a practical use case especially if you need automated emails being sent out :) keep them coming
@rahiyansafin449
@rahiyansafin449 2 жыл бұрын
BEST PATRICK GOD VIDEO EVER!!!!!!
@adebanjooluwasola4709
@adebanjooluwasola4709 Жыл бұрын
Amazing Video
@nnasim5089
@nnasim5089 Жыл бұрын
This is Great!! Loved it
@vamvdotnet
@vamvdotnet 2 жыл бұрын
Great video, Patrick! Way to go! :)
@94Andreaaa
@94Andreaaa 2 жыл бұрын
thank you man i was looking for something like this. keep up the good work.
@chessgamesonline5867
@chessgamesonline5867 2 жыл бұрын
how can we send emails for example gmail adresses?
@grumpydeveloper69
@grumpydeveloper69 2 жыл бұрын
I always forget this as well @16:58 I prefer _ for private fields but doing this manually is cumbersome. Just set the C# CodeStyle naming convention for private fields to _camelCase and when you CTRL+. it does it for you
@has_ali
@has_ali 2 жыл бұрын
Ditto. Good suggestion.
@grumpydeveloper69
@grumpydeveloper69 2 жыл бұрын
ANd at @17:08 you use GetSection but _config.GetValue("EmailHost") is much easier to use
@TheArmproducer
@TheArmproducer 2 жыл бұрын
_config["EmailHost"] even easier)
@devcharlie3377
@devcharlie3377 7 ай бұрын
In the first part of the video after connecting the smtp to try out in swagger, I am getting this error when trying out the API in swagger - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
@choipatrick7006
@choipatrick7006 2 жыл бұрын
Thank you for your video. could you please explain or add to the video for sending email with attachments. really thanks.
@QVMaster
@QVMaster Жыл бұрын
Very good and useful explanation❤
@bloggrammer
@bloggrammer 2 жыл бұрын
Mailkit doesn't work for WPF app, why? I tried to adapt this implementation to a WPF app but that didn't work.
@angelcasanchez7229
@angelcasanchez7229 2 жыл бұрын
thank you very much Patrick GOD
@deadturret4049
@deadturret4049 Ай бұрын
Can this be used with OAuth2? I have a google cloud dev console setup for my app and im able to get and refresh tokens but im not sure how to incorporate that into mailkit
@MuhammadFaizan-rl4rp
@MuhammadFaizan-rl4rp 9 ай бұрын
why do you have same email for both sender and recipient? usually it should be two different emails.
@utsabsingh1944
@utsabsingh1944 10 ай бұрын
cant we use this mail service in MVC project ? i am beginner and dont know why you have to use web API for this
@sricharan2134
@sricharan2134 Жыл бұрын
Really nice explanation..👍🏻
@PatrickGod
@PatrickGod Жыл бұрын
Thank you 🙂
@bennyo
@bennyo Жыл бұрын
So if I implement this. I can purchase a cloud SMTP and hook into that to deliver production worthy emails?
@2-8ev20
@2-8ev20 2 жыл бұрын
Hello! I need to find a solution to send emails in Blazor Webassembly, but I couldn't use this method there. Is there any trick?
@PedalsizBerkay
@PedalsizBerkay Жыл бұрын
THANKS GOD
@moshkaffy
@moshkaffy 2 жыл бұрын
nice work, keep it up.
@PatrickGod
@PatrickGod 2 жыл бұрын
Thank you so much! 😊
@angelsebastianbellomateo6954
@angelsebastianbellomateo6954 2 жыл бұрын
I love you Patrick
@PriyadarshiPrashant
@PriyadarshiPrashant Жыл бұрын
When i try to pass Object (person) i got error like TypeError : Failed To Execute fetch on Windows Request with get /Head Method cannot have body
@testtest-c4z
@testtest-c4z Жыл бұрын
Very good video, is there something that is not clear to me when I send an email using an API, it is not done through an SMTP server? How would it be sent in that case?
@onr4087
@onr4087 2 жыл бұрын
I'm doing instant operations on data using jsonresult. Is there an easier way to do this? can you make a video about it?
@NimaAghaei-o6j
@NimaAghaei-o6j Жыл бұрын
Thanks so much
@abhinjoby7107
@abhinjoby7107 7 ай бұрын
For me it's showing System.Net.Sockets.SocketException. I am facing a connection attempt failure. How to fix this?
@antoniorod3776
@antoniorod3776 2 жыл бұрын
Thanks, your video help me a lot
@Mo-ef9yt
@Mo-ef9yt 2 жыл бұрын
Very nice 👍🏿
@PatrickGod
@PatrickGod 2 жыл бұрын
Thank you! 😊
@rylaiQt-h9p
@rylaiQt-h9p 2 ай бұрын
Awesome video par
@krishtechie
@krishtechie 2 жыл бұрын
Thank you dude ✌️
@babarkhalid2746
@babarkhalid2746 Ай бұрын
How to receive (sync) emails using Mailkit?
@KN-hv3gn
@KN-hv3gn 2 жыл бұрын
Hi Patrick! Great tutorial. I have a question. I have a Visual Studio solution with the Email service project and a Razor project called Visitors. How can I consume the Email project to send emails from the Visitors project?
@dgam8
@dgam8 2 жыл бұрын
I have the same question!!!!
@dgam8
@dgam8 2 жыл бұрын
There isn't a single video on sending Email with Mailkit using Razor or Blazor....
@HiranLIVE
@HiranLIVE 2 жыл бұрын
It worked for me. BUT you need to setup an 'app password' on your Google Account if using Gmail as smtp. This is a new thing. They have deprecated the 'Less Secure App' feature.
@giorgichikovani4129
@giorgichikovani4129 2 жыл бұрын
what to do exactly in 'app password'?
@HiranLIVE
@HiranLIVE 2 жыл бұрын
@@giorgichikovani4129 You have to get an ‘app password’ on your Google Account, and use that in your code instead of your normal Gmail password.
@giorgichikovani4129
@giorgichikovani4129 2 жыл бұрын
@@HiranLIVE Tnx
@azgan123
@azgan123 2 жыл бұрын
Patrick is funny its hard not to like him 🤣🤣
@PatrickGod
@PatrickGod 2 жыл бұрын
Thank you very much! 😁
@mahydulislam
@mahydulislam 6 ай бұрын
How can I receive mail using mailkit?
@debopammandal9255
@debopammandal9255 2 жыл бұрын
how to add attachment in this email structure
@salvcri
@salvcri 2 жыл бұрын
Thanks a lot!
@PatrickGod
@PatrickGod 2 жыл бұрын
Welcome! 😊
@angelcasanchez7229
@angelcasanchez7229 2 жыл бұрын
Is it possible to make a get by id request to a table that doesn't have a primary key?
@level1245
@level1245 2 жыл бұрын
How to embed image in email using mailkit. Without using bodybuilder any example can give me link
@ZestyGuy-World
@ZestyGuy-World 2 жыл бұрын
your content muaaaaa!!!!!!
@YogeshGole-e7s
@YogeshGole-e7s Жыл бұрын
hey Actually i getting 404 error while i am testing my api of send email on postman idn why, is this beacause i am working 3.1?
@asifkhan-yi3nh
@asifkhan-yi3nh 11 ай бұрын
thanks man!!
@FerozVox
@FerozVox Жыл бұрын
Hi Patrick I am working on X509Certificate I need to check the revocation of certificate online and offline will help me to that if it is possible make some videos on that
@Ngonirow007
@Ngonirow007 2 жыл бұрын
Excellent video Patrick. My question now is how to send emails to clients that would have 2FA enable and less secure app access turned off, that is when the API is now in production. I saw a work around to send emails to Gmail accounts by having to turn 2FA and enable less secure app access which it is feasible in production
@ibrahimraboudi
@ibrahimraboudi 8 ай бұрын
this is my problem now
@bzmind_
@bzmind_ 2 жыл бұрын
Thank God :D
@GoLezhaShowMega
@GoLezhaShowMega Жыл бұрын
U'r the best
@PatrickGod
@PatrickGod Жыл бұрын
Thank you so much! 😊
@raphaellukas3328
@raphaellukas3328 2 жыл бұрын
Thanks for this informative video! I like it :-)
@PatrickGod
@PatrickGod 2 жыл бұрын
Glad to hear that!
@reitumetsemakgatho9537
@reitumetsemakgatho9537 2 жыл бұрын
Hi Patrick how can I use this API in angular
@nucasspro1
@nucasspro1 2 жыл бұрын
Could you make a video to share about read write conflict?
@dgam8
@dgam8 2 жыл бұрын
what are the chances you could do this using blazor? maybe even radzen blazor?
@sergi3056
@sergi3056 2 жыл бұрын
Perfect
@shahabjoon201
@shahabjoon201 2 жыл бұрын
Dear Mr. God, Thank you again for existing, the question is, I sent an email with the above structure (which is really perfect), but when I filled the "To" property with a real Gmail as a receiver, it sent it to the sender which is the fake email (generating by the Ethereal). Is it common or did I make a mistake? Thanks in advance Shahab
@bloggrammer
@bloggrammer 2 жыл бұрын
That's weird. Maybe you should close your VS and try again
@has_ali
@has_ali 2 жыл бұрын
It might be a restriction by Ethereal to stop you from using their service for production. You can simple use your own proper smtp service and it should be okay.
@shahabjoon201
@shahabjoon201 2 жыл бұрын
@@has_ali Thank you Hassan.
@yovanies2798
@yovanies2798 2 жыл бұрын
Me sucedió lo mismo al usar una cuenta de GMAIL, me sale error y no envía el correo. alguna novedad sobre eso.
@maurirom92
@maurirom92 2 жыл бұрын
hi, how can I attach files?, I need attach files that are in my wwwroot folder
@SaikiranNomula
@SaikiranNomula 2 жыл бұрын
How can this guarantee that all the emails with attachments will send to the receiver? Is there anything I need to use to get confirmation? reply is greatly appreciated!
@ibrahimraboudi
@ibrahimraboudi 8 ай бұрын
did u find something ?
@18_arpitpatel47
@18_arpitpatel47 2 жыл бұрын
please anyone say how to implement attachment(fileupload) in this project
@andresbeltran5779
@andresbeltran5779 Жыл бұрын
Nice very helpfull
@naturehuman9469
@naturehuman9469 4 ай бұрын
But I need to send email on Gmail account there it's not work Please guide me 😢
@allantzirin6218
@allantzirin6218 2 жыл бұрын
Thanks bro
@louisszeto31620000
@louisszeto31620000 2 жыл бұрын
Excellent video! May I ask if I store the email password in appsetting.json is safe if I deploy the app?
@chips4real1
@chips4real1 2 жыл бұрын
dont store it there
@attilaguba856
@attilaguba856 Жыл бұрын
@@chips4real1 so what is the good solution, for real deployment?
@vtminhlien8840
@vtminhlien8840 2 жыл бұрын
Can you make video login with google, firebase please
@attilaguba856
@attilaguba856 Жыл бұрын
Hi Patrick! Everything is working fine, I have made Contact Us form , but the I have got the same email address for the From and the To objects! I would like to achieve after the user gives the input ( From : user email address ) that will be the sender : email.From.Add(MailboxAddress.Parse("user_Input_email")); email.To.Add(MailboxAddress.Parse("receiver_EmailAddress")); I'm getting emails and etc but the Sender and Receiver are the same email address, ( using gmail ). How Can I fix it?
@Dartarok999
@Dartarok999 2 жыл бұрын
patrick god, could you help me, making a video explaining how to save multiple files with inputfile but save them in a local folder and show that local path in the database, it would be very helpful since I've been trying for a long time... with blazor webassembly
@dhatuan
@dhatuan 2 жыл бұрын
thank
@emmanuellarteymohammed4534
@emmanuellarteymohammed4534 2 жыл бұрын
God!, interesting
@leonardvanonselen
@leonardvanonselen Жыл бұрын
Nice video👍 do you have any suggestions on which SMTP server to use in production that is able to work seamlessly with the mailkit package? Gmail , 0365 etc. all require MFA which mailkit doesn't cater for
@EpTechie
@EpTechie 2 жыл бұрын
Great job 👍👏👏 Can you do a video for Blazor Server without API? Thanks
@vci123
@vci123 2 жыл бұрын
Broooooo!
@byte7930
@byte7930 2 жыл бұрын
Exactly what I needed right now! Thanks for your effort! If I could place a wish... I worked through your Udemy course which helped me a lot creating my first app for a friend (work in progress). But as I want to run the backend on a Linux machine I'd like to use EntityFramework with MariaDB instead of MS SQL Server. Is there any chance, you could set up a quick tutorial on that? I'd appreciate it with at least one coffee :)
@bigggmoustache8868
@bigggmoustache8868 Жыл бұрын
Seriously, ask chatgpt. If you can find something to guide you alongside it you can probably achieve your goal. It's walked me through so much it's absolutely insane.
@samsonmayeem8409
@samsonmayeem8409 Жыл бұрын
Yes
@joanesgonzaga675
@joanesgonzaga675 2 ай бұрын
In this tutorial youre implementing basic authentication, but this is discontinued. Unfortunatelly it doesn't work in 2024
@FernandoZamudioC
@FernandoZamudioC 2 жыл бұрын
Hello in the Line smtp.Connect("smtp.ethereal.email", 587, MailKit.Security.SecureSocketOptions.StartTls); return this error SslHandshakeException: An error occurred while attempting to establish an SSL or TLS connection. Any idea ? thank you !
@iamfahimshahriar
@iamfahimshahriar Жыл бұрын
were you able to solve it ?
@FernandoZamudioC
@FernandoZamudioC Жыл бұрын
@@iamfahimshahriar yes thank you
@MustafaAdel-oj4uc
@MustafaAdel-oj4uc Жыл бұрын
in my case ,i am just stop avast anti-virus and it works.
Sending Emails in ASP.NET Core using Gmail | Quick, Free and Easy
9:46
Programming with Felipe Gavilan
Рет қаралды 1,5 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
💾 File Upload with a .NET 6 Web API & Blazor WebAssembly
32:24
.NET 7 Beginner Course 🚀 Web API, Entity Framework 7 & SQL Server
2:20:13
LINQ for Beginners 🚀 Full Course
27:55
Patrick God
Рет қаралды 2,3 М.
Forget Controllers and Minimal APIs in .NET!
14:07
Nick Chapsas
Рет қаралды 79 М.
Building Real-time Apps with Go | Azim Pulat
54:58
Azim Pulat
Рет қаралды 64 М.
How to send an email in C# with .NET using Mailkit
16:46
tutorialsEU
Рет қаралды 33 М.
Арестович: Двойная игра Путина. @holovanov
1:21:58
Alexey Arestovych
Рет қаралды 452 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН