---
title: clsMailMessage
summary: API reference for clsMailMessage.
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Core.Infragistics103
reference_type: package
---

# clsMailMessage

`clsMailMessage` wraps a legacy SOAP mail web service (`SAIFMail.clsSAIFMessage`) so consuming applications can send outbound email with or without an attachment through a single, `Shared`-only API, and separately provides a generic file-streaming download helper (`StreamDownloadFile`) that is independent of the mail functionality.

## Purpose
- Send outbound email (with or without a message body) through the legacy SOAP mail service, whose endpoint URL is resolved at runtime from configuration, per the [Send email via legacy SOAP mail service](../../operations/send-email-via-legacy-soap-mail-service.md) operation.
- Send outbound email with an attachment supplied as a stream, byte array, or file path.
- Stream an existing file on disk to the HTTP response as a downloadable attachment, setting content type only for `.txt`/`.csv` extensions per [BR-CMM-001](../../business-rules.md#br-cmm-001-only-txt-and-csv-extensions-receive-an-explicit-content-type).
- Provide byte-array conversion helpers (`GetFileAsBytes`, `GetStreamAsBytes`) used internally by the attachment-sending overloads.

## Context
- Namespace: `SAIF.Presentation.Web.Core.Utilities`
- Assembly/package: `SAIF.Presentation.Web.Core.Infragistics103` (merged into `SAIF.BOF.Presentation.Web.Infragistics103` NuGet package)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| STANDARD_DISCLAIMER | `Public Const STANDARD_DISCLAIMER As String` | Standard confidentiality disclaimer text intended for inclusion in outbound email bodies. |
| DO_NOT_REPLY | `Public Const DO_NOT_REPLY As String = "This is an auto-generated email. Please do not reply to this email address."` | Standard auto-generated-email notice intended for inclusion in outbound email bodies. |
| StreamDownloadFile | `Shared Sub StreamDownloadFile(Filename As String, inPage As AppViewPageBase)` | Streams the given file to the current page's HTTP response as a download, setting `Content-Type` only for `.txt`/`.csv` extensions per [BR-CMM-001](../../business-rules.md#br-cmm-001-only-txt-and-csv-extensions-receive-an-explicit-content-type), then calls `Response.End()`. |
| SendMail | `Overloads Shared Function SendMail(inToAddress As String, inFromAddress As String, inSubject As String) As Boolean` | Sends a subject-only email via the legacy SOAP mail service; effectively always returns the default `False`* (no explicit `Return` statement). |
| SendMail | `Overloads Shared Function SendMail(inToAddress As String, inFromAddress As String, inSubject As String, inMessage As String) As Boolean` | Sends an email with subject and HTML-capable body via the legacy SOAP mail service; effectively always returns the default `False`*. |
| SendMailWithAttachment | `Overloads Shared Function SendMailWithAttachment(inToAddress As String, inFromAddress As String, inSubject As String, inStream As Stream, inAttachName As String) As Boolean` | Sends an email with an attachment supplied as a stream (no body); effectively always returns the default `False`*. |
| SendMailWithAttachment | `Overloads Shared Function SendMailWithAttachment(inToAddress As String, inFromAddress As String, inSubject As String, inMessage As String, inStream As Stream, inAttachName As String) As Boolean` | Sends an email with subject, body, and a stream attachment; effectively always returns the default `False`*. |
| SendMailWithAttachment | `Overloads Shared Function SendMailWithAttachment(inToAddress As String, inFromAddress As String, inSubject As String, inMessage As String, inFilePath As String, inAttachName As String) As Boolean` | Sends an email with subject, body, and an attachment loaded from a file path; effectively always returns the default `False`*. |
| SendMailWithAttachment | `Overloads Shared Function SendMailWithAttachment(inToAddress As String, inFromAddress As String, inSubject As String, inMessage As String, inAttachment() As Byte, inAttachName As String) As Boolean` | Sends an email with subject, body, and a pre-loaded byte-array attachment; effectively always returns the default `False`*. |
| GetFileAsBytes | `Shared Function GetFileAsBytes(inPath As String) As Byte()` | Reads the given file path fully into a byte array for use as a mail attachment. |
| GetStreamAsBytes | `Shared Function GetStreamAsBytes(inStream As Stream) As Byte()` | Reads the given stream fully into a byte array for use as a mail attachment; returns `Nothing` if `inStream` is `Nothing`. |

## Behavioral notes
- All six `SendMail`/`SendMailWithAttachment` overloads instantiate `New SAIFMail.clsSAIFMessage`, set its SOAP endpoint `.Url` from `AppGlobal.EnvironmentService.GetConfigSetting("LegacyMailWebServiceUrl")`, invoke the corresponding proxy method, then dispose the proxy — with no error handling around the SOAP call.
- None of the six send methods contain an explicit `Return` statement in their observed bodies, so they effectively always return the default `False`*.
- `StreamDownloadFile` leaves `Content-Type` as an empty string for any file extension other than `.txt`/`.csv`, per [BR-CMM-001](../../business-rules.md#br-cmm-001-only-txt-and-csv-extensions-receive-an-explicit-content-type).

## Constraints and usage notes
- The `SAIFMail.clsSAIFMessage` SOAP proxy type used by every send method is not defined in this project's own references; it is presumed supplied transitively through one of this project's `ProjectReference`s**.
- `StreamDownloadFile` requires an `AppViewPageBase`-derived page instance to resolve the physical file path (`Server.MapPath`) and write to the HTTP response.
- All members are `Shared`; this class holds no instance state.

> **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.Presentation.Web.Core.Infragistics103\clsMailMessage.vb
