SendAs Overview

This section describes the overview and functions provided by the SendAs component.

Purpose

The SendAs component provides a high-level APIs for client applications that wish to include a SendAs menu to allow users to send content through any of the supported message types. It acts as a wrapper that allows access to the common functionality of email, SMS, and OBEX components.

For example, SendAs allows a word processor document to be sent as an email, or a contact as a vCard (either attached to an email or as an SMS).

Key terms

SendAs Server

The server that maintains and controls access to all the SendAs entries.

Message Type Module (MTM)

A group of components that together provide message handling functionality for a particular protocol.

Architecture

The main client-side API is the RSendAs class. Client applications use this to connect to the SendAs Server.

Client applications create messages using the RSendAsMessage API. Opening an RSendAsMessage object on SendAs Server session creates a SendAs message in the SendAs Server. This allows client applications to create multiple messages concurrently.

Important: There is no exposure to Message Server APIs on the client-side. The SendAs Server encapsulates the Message Server completely.

Figure 1. SendAs architecture

SendAs Server

The SendAs Server maintains all SendAs entries and controls the access to a Message Store. It allows client applications to create messages in the Drafts folder of a Message Store. The SendAs APIs also allow a client application to launch an appropriate message editor for a given message type. They support two methods of sending messages: confirmed or unconfirmed send. A confirmed send requires a confirmation by the UI MTM; typically it queries the phone user. An unconfirmed send does not require confirmation by the UI MTM.

The following are the key functions of SendAs Server :

  • Get a list of the names of the MTMs that have the required capabilities.

  • Get a list of the services that can be used with the chosen MTM.

  • Create a message, define the body and attachments for that message, without forcing the client application to start any message-specific user interface.

  • Store the message so that it is ready for sending from the device next time it is connected to the appropriate service.

  • Send the message.

  • Start the editor for the message type.

  • Allow client applications to query the message type.

API summary

The following are the two main SendAs Server classes:

Typical use cases

The RSendAs class is used for the following tasks:

  • Connecting to and disconnecting from the SendAs Server

  • Querying the message type registry

The RSendAsMessage class is used for the following tasks:

  • Creating and managing a SendAs message

  • Launching a message editor for the created SendAs message

  • Modifying a SendAs message

  • Sending a SendAs message