Skip to content

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

  1. Create a SAIFMail.clsSAIFMessage SOAP client instance.
  2. Set the client's Url from AppGlobal.EnvironmentService.GetConfigSetting("LegacyMailWebServiceUrl"). (BR-CORE-024)
  3. Origin: Delegates to the SAIF framework environment service (AppGlobal.EnvironmentService, package SAIF.BOF.Framework); the callee's own configuration-resolution steps are not visible from this repository.**

  4. No null/empty guard surrounds this call — a missing setting produces an unusable proxy URL at send time.*
  5. For attachment overloads, materialize the attachment as a byte array:
  6. If supplied as a file path: call GetFileAsBytes.
  7. If supplied as a stream: call GetStreamAsBytes.
  8. Invoke the remote SendMail / SendMailWithAttachment SOAP operation with the assembled parameters.
  9. 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 / SendMailWithAttachment overloads are declared As Boolean but contain no Return statement, so they always yield False regardless of whether the mail was actually dispatched.* Callers that branch on the return value will always take the failure path.
  • LegacyMailWebServiceUrl is resolved on every call rather than cached, making mail delivery sensitive to environment-service availability at send time.*

Sources

  • SAIF.Presentation.Web.Core.Infragistics111/clsMailMessage.vb