Sending a message to another device

With the Send UI API, you can allow the mobile device user to choose any message type available on the mobile device. This way, you do not need to know what message types are available.

It is also possible to limit the message types that the mobile device user can choose from.

To send a message to another device:

  1. Create an instance of CSendUI to enable your application to use the functionality of the Send UI API.

    Note: When you use the Send UI API, it automatically opens a message editor. If you want to send a message without opening an editor, see the MMS Client MTM API or the SendAs API in the Symbian OS Library.

  2. Use CSendUi::AddSendMenuItemL to add the Send item to your options menu.

  3. Create an instance of the CMessageData class. If you wish to open an editor without any content from your application, do not set any of the CMessageData parameters. If you wish to pass information from your application to the editor that opens, set the appropriate parameters of CMessageData.

  4. Depending on your requirements, use one of the following methods to send your message:

  5. If you wish to limit the options presented to the mobile device user, use TSendingCapabilities::TSendingFlags to define which capabilities your message requires - or specify the UIDs of the services that should not be offered.

    You can find the service UIDs in the header senduiconsts.h. For more information on UIDs, see How to use UIDs in the Symbian OS Library.

  6. Include sendui.h and senduiconsts.h in the appropriate class file(s).

    The senduiconsts.h header file defines the constants for available messaging services from which you can choose.

  7. Make sure you have the correct capabilities for the classes you are using.

  8. Make sure sendui.lib is accessible to your linker when compiling your application by including it in your application mmp file or by editing the project properties in your IDE, depending on your build environment.

    For information on mmp files, project properties, IDE, and the build environment, see Getting started.

Additional information

For more information, see Additional information on sending a message and Related S60 APIs in Sending a message.