HIPAAsuite.AuroraModules.Mailer
Class Reference
Type Description
No example provided
Type Description
This class is a vendor-agnostic representation of an email. It supports standard fields like To, CC, BCC, Subject, Body (Text/HTML), and Attachments.
In this solution, messages are often used to deliver batch summaries, report exports, or operational alerts after parsing completes.
Usage Example
var email = new EmailMessage
{
From = "no-reply@company.com",
FromName = "Automated System",
Subject = "Daily Report",
Body = "<h1>Report</h1>",
IsHtml = true
};
email.To.Add("manager@company.com");
Type Description
No example provided
Type Description
This service handles the full lifecycle of an SMTP transmission: connecting to the server, authenticating, constructing the MIME message, sending it, and disconnecting.
Features:
- Secure: Supports SSL/TLS and STARTTLS via IMailConfiguration settings.
- Proxy Support: Can route traffic through a proxy via IProxyFactory.
- Attachments: Fully supports sending file attachments from streams.
Usage Example
var config = new MyMailConfig { ... };
var mailer = new MailKitMailer(config);
await mailer.SendAsync(myMessage);
Type Description
No example provided
Type Description
No example provided
Type Description
No example provided
Interface Reference
Type Description
This interface provides the necessary details to connect to, authenticate with, and secure a connection to an SMTP server. It is primarily used by MailKitMailer.
Security Note: Implementations should ensure that sensitive information like Password is handled securely.
These settings are typically loaded from app configuration and reused for operational notifications such as batch summaries or failure alerts.
Usage Example
var config = new MyMailConfig
{
Host = "smtp.example.com",
Port = 587,
SecureSocketOptions = SecureSocketOptions.StartTls,
Username = "user",
Password = "secret_password"
};
Type Description
Implementations of this interface may use various transport mechanisms, such as SMTP (via MailKit) or vendor-specific APIs (e.g., SendGrid, Mailgun, Amazon SES).
In this solution, mailers are often used to distribute batch summaries, report exports, and incident notifications after validation completes.
Key Features:
- Abstraction: Decouples application logic from the specific email sending mechanism.
- Asynchronous: Fully supports Task-based asynchronous patterns.
- Cancellation: Supports cancellation via CancellationToken.
Usage Example
public class MyService
{
private readonly IMailerService _mailer;
public MyService(IMailerService mailer)
{
_mailer = mailer;
}
public async Task NotifyUserAsync(string email)
{
var message = new EmailMessage
{
To = { email },
Subject = "Welcome!",
Body = "Hello World"
};
await _mailer.SendAsync(message);
}
}