---
title: Send email via legacy SOAP mail service
summary: Sends outbound email, optionally with an attachment, through a legacy SOAP mail web service.
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Core.Infragistics103
reference_type: package
operation_id: OP-CMM-001
trigger: Explicit call from consuming application code
---

# Send email via legacy SOAP mail service

This operation sends an outbound email, with or without an attachment, by delegating to a legacy SOAP web service whose endpoint URL is resolved at runtime from configuration.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-CMM-001 |
| **Trigger** | Explicit call from consuming application code |
| **Inputs** | To/from/subject address strings; optional message body; optional attachment as stream, byte array, or file path |
| **Outputs** | `Boolean` (declared but no explicit `Return` statement is present in the observed bodies, so these methods effectively always return the default `False`)* |
| **Primary components** | `Utilities.clsMailMessage.SendMail` (2 overloads), `SendMailWithAttachment` (4 overloads) |
| **Entry point** | `SAIF.Presentation.Web.Core.Infragistics103\clsMailMessage.vb` |

## Steps

1. Instantiates `New SAIFMail.clsSAIFMessage` (a generated SOAP proxy)**.
2. Sets its `.Url` (via `CType(m_mailmsg, System.Web.Services.Protocols.SoapHttpClientProtocol).Url`) from `AppGlobal.EnvironmentService.GetConfigSetting("LegacyMailWebServiceUrl")` — configuration-driven endpoint resolution.
3. Calls `SendMail(inToAddress, inFromAddress, inSubject, inMessage)` for plain-text email, or `SendWithAttach(inToAddress, inFromAddress, inSubject, inMessage, attachmentBytes, inAttachName)` when an attachment is supplied.
   - For attachment overloads: the attachment is passed as a byte array, obtained via `GetFileAsBytes` (file-path overload) or `GetStreamAsBytes` (stream overload).
4. Disposes and nulls the proxy instance.
   - On failure: no error handling around the SOAP call is present; a service fault propagates as an unhandled exception.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([SendMail / SendMailWithAttachment called]) --> S1[New SAIFMail.clsSAIFMessage proxy]
	S1 --> S2[Resolve LegacyMailWebServiceUrl from config]
	S2 --> S3{Attachment provided?}
	S3 -->|Yes, stream| S4a[GetStreamAsBytes]
	S3 -->|Yes, file path| S4b[GetFileAsBytes]
	S3 -->|No| S4c[Skip attachment conversion]
	S4a --> S5[Call SendWithAttach on proxy]
	S4b --> S5
	S4c --> S6[Call SendMail on proxy]
	S5 --> S7[Dispose proxy]
	S6 --> S7
	S7 --> EndOk([Return default False])
```

## Failure and edge-case behavior
- No error handling around the SOAP call is present; a service fault would propagate as an unhandled exception.
- All six overloads have no explicit `Return` statement in their observed bodies, so they effectively always return the default `False`*.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Configuration settings](../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.Presentation.Web.Core.Infragistics103\clsMailMessage.vb
