EmailNotificationService

Models & Types · AiDotNet.TrainingMonitoring.Notifications

Email notification service using SMTP.

Implements: INotificationService

How It Works

For Beginners: This service sends training notifications via email. It supports various email providers like Gmail, Outlook, and custom SMTP servers.

Example usage:

Note: For Gmail, you need to use an “App Password” (not your regular password). Enable 2FA and generate an app password in your Google Account settings.

Constructors

Constructor Summary
EmailNotificationService(EmailConfiguration configuration) Creates a new email notification service.

Properties

Property Summary
bool IsConfigured { get; }
string ServiceName { get; }

Methods

Method Summary
Task<bool> SendAsync(TrainingNotification notification, CancellationToken cancellationToken)
Task<bool> TestConnectionAsync(CancellationToken cancellationToken)
bool Send(TrainingNotification notification)
void Dispose() Disposes the email service resources.