Send email with body¶
This is the library's general-purpose send operation: it delivers a subject line together with an explicit message body, in HTML or plain text, through the legacy SOAP mail service. It is the operation most application code uses when the outbound message needs actual content rather than just a subject.
| Field | Value |
|---|---|
| Operation ID | MAIL-OP-002 |
| Trigger | Caller invokes Mail.SendMail(inToAddress, inFromAddress, inSubject, inMessage, [isHtml]). |
| Inputs | inToAddress, inFromAddress, inSubject, inMessage, 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¶
- Create a new
SAIFMail.clsSAIFMessageSOAP client dedicated to this call. - Look up the mail endpoint by calling
AppGlobal.EnvironmentService.GetConfigSetting("legacyMailServiceUrl")and assign the result to the proxy'sUrlproperty (BR-001). AppGlobal.EnvironmentServicelazily selectsWindowsEnvironmentServiceorWebEnvironmentServicedepending on whether the call is running inside an HTTP request context.GetConfigSettingrefreshes configuration when it is stale, honors a developer override ahead of the loaded configuration, and returns the resolved setting value.- If the key is absent, the delegated lookup throws before the message is dispatched.
Origin: Steps 2.1–2.3 are implemented in Retrieve a configuration setting (
SAIF.Framework.Security.EnvironmentApi) and are executed on behalf of this operation. 3. Select the transmission format from theisHtmlflag (BR-002). - When the caller omitsisHtml, VB's default-parameter value suppliesTrue. - IfisHtmlisTrue, callSendMail(inToAddress, inFromAddress, inSubject, inMessage). - IfisHtmlisFalse, callSendMailAsText(inToAddress, inFromAddress, inSubject, inMessage). 4. Dispose the SOAP proxy and clear the module-level reference. 5. ReturnTrueonce the dispatch path completes (BR-003). - On failure: exceptions raised during endpoint resolution or the SOAP call propagate unchanged to the caller, since this function has no local error handling.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([SendMail body call]) --> Proxy[Create clsSAIFMessage]
Proxy --> Url[Resolve legacyMailServiceUrl]
Url --> Html{isHtml?}
Html -->|True| HtmlSend[Call SendMail with body]
Html -->|False| TextSend[Call SendMailAsText with body]
HtmlSend --> Dispose[Dispose proxy]
TextSend --> Dispose
Dispose --> End([Return True])
Failure and edge-case behavior¶
inMessageis forwarded to the SOAP proxy exactly as supplied; the library performs no local validation, trimming, encoding adjustment, or disclaimer insertion on the body text.- Configuration lookup failures and SOAP-layer failures both surface as unhandled exceptions, since no recovery logic exists anywhere in this call path.
- Reaching the final
Return Truestatement is the only success signal this function produces; it does not reflect any acknowledgement returned by the remote mail service.
Related documentation¶
- Operations and processes
- Overview
- Architecture
- Dependencies
- Business rules
- Configuration
- API reference
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