As Panagiotis Kanavos says, the Blazor server-side is an ASP.NET Core server application. ASP.NET Core has build-in library to run the background service. The ASP.NET Core could run both Blazor service and background service.
You could use Blazor to handle user input and then use background server to send Email at specific time.
More details, you could refer to this article and below code sample:
public class TestHostedService: BackgroundService
{
private readonly ILogger _logger;
public TestHostedService(ILoggerFactory loggerFactory)
{
_logger = loggerFactory.CreateLogger<TestHostedService>();
}
protected async override Task ExecuteAsync(
CancellationToken cancellationToken)
{
do
{
if (DateTime.Now.Hour == 11)
{
//do something
}
//fired every one hour
await Task.Delay(TimeSpan.FromHours(1), cancellationToken);
}
while (!cancellationToken.IsCancellationRequested);
}
}
To run it, you should add it as HostedService.
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
}).ConfigureServices((hostcontext, service) => {
service.AddHostedService<TestHostedService>();
});