Linux serverNETWORK ADMINISTRATIONSsmtp server liux

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

🚀 Get the .NET 8 Web Dev Jump-Start Course for FREE: https://dotnet8.patrickgod.com
💖 Support me on Patreon for exclusive source code access: https://patreon.com/_PatrickGod
🐦 Let’s get social on X: https://x.com/_PatrickGod
🔗 Let’s connect on LinkedIn: https://www.linkedin.com/in/patrickgod/
💻 GitHub: https://github.com/patrickgod/SimpleEmailApp

📚 My .NET & Blazor Udemy Courses:
🚀 .NET Jumpstart Course: https://www.udemy.com/course/net-core-31-web-api-entity-framework-core-jumpstart/?referralCode=DOTNET7
🔥 Blazor E-Commerce Course: https://www.udemy.com/course/blazor-ecommerce/?couponCode=YOUTUBE
🔥 Blazor Bootcamp: https://www.udemy.com/course/blazor-webassembly/?referralCode=647B4EAACD6D8E4E6872

📑 Table of Contents:
00:00 Send Email with a .NET 6 Web API using Mailkit & SMTP 📧
01:55 Create an ASP.NET Core Web API Project
02:33 Install Mailkit
03:39 Create a Controller
04:00 Use Ethereal as SMTP Service
04:41 Implement SendEmail() method
10:38 Test with Swagger
11:45 Implement and Inject an EmailService
15:52 Use the AppSettings for Host, Username & Password
18:31 Change the Controller
19:17 Final Test

#DotNet #WebAPI #PatrickGod

source

by Patrick God

linux smtp server

20 thoughts on “Send Email with a .NET 6 Web API using Mailkit & SMTP 📧

  • So if I implement this. I can purchase a cloud SMTP and hook into that to deliver production worthy emails?

  • 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?

  • 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

  • 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.

  • 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?

  • 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

  • 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

  • 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?

Comments are closed.