MmsAddContentEx Function

Action

Adds content data to the MMS body. The content type is specified as text. Use this function to append content with no well-known (numeric) content type.

Include file

MmsLib.bdh

Syntax

MmsAddContentEx( in hMms             : number,
                 in sData            : string,
                 in nDataLen         : number,
                 in sContentType     : string,
                 in sContentId       : string,
                 in nContentLocation : string ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hMms Handle for the MMS, returned by a call to MmsCreateMms.
sData Data to add to the MMS body.
nDataLen Length of the data.
sContentType Specifies the content type. See mmslib.bdh for available values.
sContentId Specifies the content ID.
sContentLocation Specifies the content location.

Example

dcltrans
  transaction TInit
    var
    hMms : number;
  begin
    MmsCreateMms(hMms);
    MmsSetHeader(hMms, MMS_HEADER_MsgType, MMS_M_SEND_REQ);
    MmsSetHeader(hMms, MMS_HEADER_MmsVersion, MMS_MSGVERSION_10);
    MmsSetHeader(hMms, MMS_HEADER_ContentType, WAP_CONTENT_ApplicationVndWapMultipartRelated);
    MmsSetHeaderString(hMms, MMS_HEADER_From, "31743678001");
    MmsSetHeaderString(hMms, MMS_HEADER_To, "31743689031");
    MmsSetHeaderString(hMms, MMS_HEADER_TransactionId, "17");
    MmsAddContentEx(hMms, "only text", 9, "text/plain", "text", "text");
    WebPostMms("http://10.5.8.12:8899/mmsc", hMms);
    MmsDeleteMms(hMms);
  end TInit;