A background service that periodically sends emails to entered email addresses.
You should add current email info in SendMail function in PeriodicSendMailService. No database configuration is required as the EF Core In Memory package is used.
Background service send email to all addresses in memory at every 30 second. You can edit period for your scenario.
while(!stoppingToken.IsCancellationRequested)
{
SendMail();
Console.WriteLine("Mails sent.");
await Task.Delay(30000, stoppingToken);
}