共用方式為


SPMobileMessageSmsBuilder Class

Provides members to manage the final construction of the Short Message Service (SMS) message that is sent to the messaging service for delivery and to add certain metadata to it.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.MobileMessage.SPMobileMessageBuilder
    Microsoft.SharePoint.MobileMessage.SPMobileMessageSmsBuilder

Namespace:  Microsoft.SharePoint.MobileMessage
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public NotInheritable Class SPMobileMessageSmsBuilder _
    Inherits SPMobileMessageBuilder
'Usage
Dim instance As SPMobileMessageSmsBuilder
public sealed class SPMobileMessageSmsBuilder : SPMobileMessageBuilder

Remarks

If a message exceeds the service provider’s limit on the number of characters, the message construction algorithm will attempt to divide the message that into multiple messages by splitting the message between “chunks” of text. A “chunk” of text is a run of characters that should stay together in a single message, if possible. This will make the resulting series of messages more coherent than if the parent message was divided into equal, but arbitrarily divided, parts. If a given chunk itself exceeds the limit, it will be split anyway.

The SPMobileMessageSmsBuilder class provides three ways to build the message.

  • Your code can call the static BuildSmsMessage(SPMobileMessagingAccount, String, String) method and pass it parameters for the sender’s account, a recipient, and the text for the message. This is the simplest, but least flexible way.

  • Your code can call one of the overloads of SetTextContent(). This would require you to first construct the SPMobileMessageSmsBuilder and add recipients with calls of AddRecipient(String). But this way of building the message gives you the option to have multiple recipients and also to set a lower limit, than the limit imposed by the service provider, on the number of child pages (ContentParts) into which the message is split if the message text exceeds the character limit imposed by the service.

  • Your code can create a messaging building transaction. Such a transaction consists of the following:

    1. A call of StartTextMessage()

    2. One or more calls of AddChunk(String)

    3. A call of one of the overloads of EndTextMessage()

    This way of building the message gives you all the options as the preceding way, but also gives you greater control over how the message is split into pages and more options, such as the option to add page numbers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPMobileMessageSmsBuilder Members

Microsoft.SharePoint.MobileMessage Namespace