---
title: SAIF.Framework.Mail overview
summary: High-level purpose, scope, and responsibilities for this library.
status: draft
owner: <owner>
last_reviewed: 2026-07-23
library: SAIF.Framework.Mail
reference_type: package
---

# SAIF.Framework.Mail overview

> **Documentation context:** Packaged Component (NuGet)
>
> `SAIF.Framework.Mail` is bundled into the `SAIF.BOF.Framework` NuGet package via a source-glob
> mechanism in `SAIF.Framework.Core\SAIF.BOF.Framework.Core.nuspec` rather than via a project
> reference or front-end entry-point.*

`SAIF.Framework.Mail` is a thin, stateless utility library that exposes a simplified static API (`Public Module Mail`) for sending email through a legacy ASMX/SOAP mail service (`clsSAIFMessage.asmx`). It contains no business objects or persistent state; every public function marshals parameters into a generated SOAP proxy call and returns.

## Purpose
- Provide application and business-layer code with a single, simplified entry point for sending email — subject-only, subject+body, HTML/plain-text, and attachment (stream, file path, byte array) variants — without requiring callers to interact with the underlying SOAP proxy directly.
- Consumed by any business or application code in the repository that needs to send email through the legacy `clsSAIFMessage.asmx` web service.*

## Responsibilities
- Provide a single, simplified entry point (`Public Module Mail`) for sending email with subject-only, subject+body, HTML/plain-text, and attachment (stream, file path, byte array) variants.
- Marshal caller-supplied parameters into calls against the generated `SAIFMail.clsSAIFMessage` SOAP proxy.
- Resolve the target mail service endpoint at call time from environment configuration (`legacyMailServiceUrl`) rather than using the design-time default baked into `app.config`/Settings.
- Provide small file/stream utility helpers (`GetFileAsBytes`, `GetStreamAsBytes`) used internally to prepare attachment byte arrays.

## Key components
- `Public Module Mail` (`MailServices.vb`): the sole public-facing component; exposes all `SendMail`/`SendMailWithOptions`/`SendMailWithAttachment` overloads, the two constants (`STANDARD_DISCLAIMER`, `DO_NOT_REPLY`), and the internal `GetFileAsBytes`/`GetStreamAsBytes` helpers.
- `SAIFMail.clsSAIFMessage` (`Web References\SAIFMail\Reference.vb`): an auto-generated ASMX/SOAP client proxy consumed internally by every `Send*` function; treated as an external service client rather than a library component.

## Related documentation
- [Index](index.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Configuration](configuration.md)
- [API reference](api/index.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Framework.Mail\MailServices.vb`
- `SAIF.Framework.Mail\SAIF.BOF.Framework.Mail.vbproj`
- `SAIF.Framework.Core\SAIF.BOF.Framework.Core.nuspec`
