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)...
该示例展示了如何在.net 6项目中创建一个托管服务,用于发送电子邮件并支持自动重试,重试次数可在appsettings.json中配置。此示例基于moreno gentili项目,感谢其提供的信息。