Open an e-mail compose window from the browser¶
This operation registers client-side script that opens the user's default e-mail client via a mailto: URL, sanitizing recipient and subject text before they are placed in the URL.
| Field | Value |
|---|---|
| Operation ID | OP-CORE-008 |
| Trigger | Consuming page action |
| Inputs | Recipient, optional CC, subject, body |
| Outputs | Registered client script that opens a mailto: window |
| Primary components | AppViewPageBase.OpenEmailPopup, AppViewPageBase.OpenEmailScriptManager |
| Entry point | SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb |
Steps¶
- Sanitize the recipient and subject via
Utilities.clsStringUtilities.CleanForEmail. (BR-CORE-025) -
Origin: Sanitization logic is implemented in Clean text for output (
SAIF.Presentation.Web.Core.Infragistics111, this library). - Note: the body sanitization call is commented out in source and is therefore not active.*
- Format the
mailto:string: - If no CC was supplied:
mailto:{0}?subject={1}&body={2}. - If a non-empty CC was supplied:
mailto:{0}?cc={1}&subject={2}&body={3}. (BR-CORE-026) - Register the resulting
window.open(...)script: - Via
ClientScriptfor the popup variant (OpenEmailPopup). - Via
ScriptManager.RegisterClientScriptBlockfor the partial-postback variant (OpenEmailScriptManager).
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Consuming page action]) --> S1[CleanForEmail: sanitize recipient and subject]
S1 --> S2{Non-empty CC supplied?}
S2 -->|Yes| S3["Format mailto: with cc="]
S2 -->|No| S4["Format mailto: without cc="]
S3 --> S5{Popup or partial-postback variant?}
S4 --> S5
S5 -->|Popup| S6[Register via ClientScript]
S5 -->|Partial postback| S7[Register via ScriptManager.RegisterClientScriptBlock]
Failure and edge-case behavior¶
- Body text is not sanitized (the sanitization call for body is commented out), so body content placed in the
mailto:URL is not passed throughCleanForEmail.* - Neither overload validates that the recipient is a well-formed e-mail address before building the
mailto:string.
Related documentation¶
Sources¶
SAIF.Presentation.Web.Core.Infragistics111/AppViewPageBase.aspx.vb