Section:

HIPAAsuite.AuroraModules.Mailer

Class

Class Reference

7 Items

Type Description
Configuration settings for Amazon SES (Simple Email Service).
Detailed Remarks
This configuration is used for SMTP-based connections to SES.

No example provided

Type Description
Represents a generic email message to be sent via IMailerService.
Detailed Remarks

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
Configuration settings for the Mailgun API.
Detailed Remarks

No example provided

Type Description
An implementation of IMailerService that uses the MailKit library to send emails via SMTP.
Detailed Remarks

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
Configuration settings for the Postmark API.

No example provided

Type Description
Configuration settings for the SendGrid API.
Detailed Remarks
See SendGrid Documentation for API key generation.

No example provided

Type Description
Configuration settings for the SparkPost API.

No example provided

Interface

Interface Reference

2 Items

Type Description
Defines configuration settings for SMTP-based email services.
Detailed Remarks

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
Defines the contract for a service capable of sending emails.
Detailed Remarks

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
Basic Usage:
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);
    }
}