The example in the github repository below shows how a Hosted Service for sending emails with automatic retry (number of attempts and number of retries configurable in the appsettings.json file) in a project developed with .NET 6 (it will be migrated to .NET 8 in the next weeks).
This example is a fork of a project developed by Moreno Gentili (Repository), whom I thank for providing me with the information necessary to complete the implementation
Comments and/or suggestions are always welcome.
Top comments (5)
This is a great guide on setting up a background email sender in .NET! The use of a hosted service with configurable retries makes it a reliable solution for handling automated emails efficiently. Looking forward to the .NET 8 migration and future updates. Thanks for sharing such a helpful resource.
Soon I will publish a new repository on my GitHub profile with the updated version to .NET 8.
If you like, follow me on my github profile (github.com/AngeloDotNet) to stay updated on future developments.
Hi @jhon_blair i migrated the BackgroundEmailSender project to .NET 8, you can find the code in this public repository: github.com/AngeloDotNet/NET8-Backg....
If you have suggestions on how to improve it and/or any implementations you would like to have, please open a dedicated issue on this project's repository and if you like my open source work don't forget to "follow" me on GitHub.
Great post, Angelo! π
I really like how you implemented the background email sender with configurable retry logic β itβs a clean and practical approach for real-world applications. The use of a Hosted Service in .NET 6 makes it both efficient and scalable. Looking forward to seeing the migration to .NET 8 and exploring how the performance improves. Thanks for sharing this valuable example! π
Thank you so much @noman_raza_f54fecbde838f8, the project (currently running .NET 8) will soon be migrated, along with other projects on my GitHub profile, to .NET 10, which is just being released.
Stay Tuned π