---
title: Send subject-only email
summary: Sends a message that has recipients and a subject line but no body text, choosing an HTML or plain-text SOAP method according to the caller's format flag.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-07-30
library: SAIF.Framework.Mail
reference_type: package
operation_id: MAIL-OP-001
trigger: Caller invokes `Mail.SendMail(inToAddress, inFromAddress, inSubject, [isHtml])`.
---

# Send subject-only email

This operation lets a caller notify a recipient by subject alone — useful when the subject line itself is the message, such as a simple status ping. It resolves the mail service endpoint at call time, picks the HTML or plain-text SOAP method, and always reports success once the SOAP call has been issued.

| Field | Value |
| --- | --- |
| **Operation ID** | MAIL-OP-001 |
| **Trigger** | Caller invokes `Mail.SendMail(inToAddress, inFromAddress, inSubject, [isHtml])`. |
| **Inputs** | `inToAddress`, `inFromAddress`, `inSubject`, optional `isHtml`. |
| **Outputs** | SOAP dispatch to the legacy mail service; the function returns `True`. |
| **Primary components** | `Mail.SendMail`, `SAIFMail.clsSAIFMessage`, `AppGlobal.EnvironmentService` |
| **Entry point** | `SAIF.Framework.Mail\MailServices.vb` |

## Steps

1. Create a new `SAIFMail.clsSAIFMessage` SOAP client for this call; no proxy instance is reused across invocations.
2. Look up the mail endpoint by calling `AppGlobal.EnvironmentService.GetConfigSetting("legacyMailServiceUrl")` and assign the result to the proxy's `Url` property ([BR-001](../business-rules.md#br-001-mail-is-always-routed-through-the-configured-legacy-mail-service-url)).
   - `AppGlobal.EnvironmentService` lazily instantiates `WindowsEnvironmentService` when `HttpContext.Current Is Nothing`, or `WebEnvironmentService` otherwise.
   - `GetConfigSetting` refreshes stale cached configuration, checks a developer override first, and only then returns the value loaded from configuration.
   - If `legacyMailServiceUrl` cannot be resolved, the lookup throws before any mail request is attempted.

   > **Origin**: Steps 2.1–2.3 are implemented in [Retrieve a configuration setting](../../saif-framework-security-environmentapi/operations/retrieve-configuration-setting.md) (`SAIF.Framework.Security.EnvironmentApi`) and are executed on behalf of this operation.
3. Select the transmission format from the `isHtml` flag ([BR-002](../business-rules.md#br-002-html-body-is-the-default-format)).
   - When the caller omits `isHtml`, VB's default-parameter value supplies `True`.
   - If `isHtml` is `True`, call `SendMail(inToAddress, inFromAddress, inSubject, String.Empty)`.
   - If `isHtml` is `False`, call `SendMailAsText(inToAddress, inFromAddress, inSubject, String.Empty)`.
4. Dispose the SOAP proxy and clear the module-level reference so the next call starts from a clean instance.
5. Return `True` once the dispatch path completes ([BR-003](../business-rules.md#br-003-send-operations-always-report-success-regardless-of-actual-outcome)).
   - On failure: any exception from endpoint resolution or the SOAP call itself propagates to the caller unmodified, because this function contains no `Try...Catch` handling of its own.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    Start([SendMail subject-only call]) --> Proxy[Create clsSAIFMessage]
    Proxy --> Url[Resolve legacyMailServiceUrl]
    Url --> Html{isHtml?}
    Html -->|True| HtmlSend[Call SendMail with empty body]
    Html -->|False| TextSend[Call SendMailAsText with empty body]
    HtmlSend --> Dispose[Dispose proxy]
    TextSend --> Dispose
    Dispose --> End([Return True])
```

## Failure and edge-case behavior

- A missing or unresolvable `legacyMailServiceUrl` setting stops the operation before any SOAP request reaches the network.
- The function never inspects a response payload or status code from the mail service; "success" simply means execution reached the final `Return True` statement without an exception.
- Because the endpoint is reassigned on every call, the design-time URL baked into the generated proxy is always overwritten before dispatch, so it has no effect at runtime.

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

## Sources
- SAIF.Framework.Mail\MailServices.vb
- SAIF.Framework.Mail\Web References\SAIFMail\Reference.vb
- SAIF.Framework.Security\AppGlobal.vb
- SAIF.Framework.Security.EnvironmentApi\Core\Services\IEnvironmentService.cs
- SAIF.Framework.Security.EnvironmentApi\Services.Common\EnvironmentServiceBase.cs
