Send mail through the legacy mail service¶
This operation dispatches outbound e-mail through the legacy SAIF mail SOAP web service, whose endpoint URL is resolved from configuration on every call. Six overloads support plain messages and attachments supplied as a stream, byte array, or file path.
| Field | Value |
|---|---|
| Operation ID | OP-CORE-007 |
| Trigger | Called by consuming applications/models |
| Inputs | To address, from address, subject, optional body, optional attachment (stream, byte array, or file path) and attachment name |
| Outputs | Mail dispatched by the remote service |
| Primary components | Utilities.clsMailMessage.SendMail, Utilities.clsMailMessage.SendMailWithAttachment |
| Entry point | SAIF.Presentation.Web.Core.Infragistics111/clsMailMessage.vb |
Steps¶
- Create a
SAIFMail.clsSAIFMessageSOAP client instance. - Set the client's
UrlfromAppGlobal.EnvironmentService.GetConfigSetting("LegacyMailWebServiceUrl"). (BR-CORE-024) -
Origin: Delegates to the SAIF framework environment service (
AppGlobal.EnvironmentService, packageSAIF.BOF.Framework); the callee's own configuration-resolution steps are not visible from this repository.** - No null/empty guard surrounds this call — a missing setting produces an unusable proxy URL at send time.*
- For attachment overloads, materialize the attachment as a byte array:
- If supplied as a file path: call
GetFileAsBytes. - If supplied as a stream: call
GetStreamAsBytes. - Invoke the remote
SendMail/SendMailWithAttachmentSOAP operation with the assembled parameters. - Dispose the SOAP client and null the reference.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([SendMail / SendMailWithAttachment called]) --> S1[Create SAIFMail.clsSAIFMessage client]
S1 --> S2[Set Url from LegacyMailWebServiceUrl]
S2 --> S3{Attachment supplied?}
S3 -->|File path| S4[GetFileAsBytes]
S3 -->|Stream| S5[GetStreamAsBytes]
S3 -->|None| S6[No attachment payload]
S4 --> S7[Invoke remote SendMail operation]
S5 --> S7
S6 --> S7
S7 --> S8[Dispose client, null reference]
Failure and edge-case behavior¶
- The
SendMail/SendMailWithAttachmentoverloads are declaredAs Booleanbut contain noReturnstatement, so they always yieldFalseregardless of whether the mail was actually dispatched.* Callers that branch on the return value will always take the failure path. LegacyMailWebServiceUrlis resolved on every call rather than cached, making mail delivery sensitive to environment-service availability at send time.*
Related documentation¶
Sources¶
SAIF.Presentation.Web.Core.Infragistics111/clsMailMessage.vb