MmsSetHeader Function

Action

Sets a MMS header. The MMS_HEADER_MsgType is a mandatory header that specifies the MMS type. Based on the MMS type, all other headers are either mandatory or optional. See the MMS Encapsulation Protocol specification for details.

Include file

MmsLib.bdh

Syntax

MmsSetHeader( in hMms    : number,
              in nHeader : number,
              in nValue  : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hMms Handle for the MMS, returned by a call to MmsCreateMms.
nHeader One of the following constants:
  • MMS_HEADER_ContentType
  • MMS_HEADER_Date
  • MMS_HEADER_DeliveryReport
  • MMS_HEADER_MsgClass
  • MMS_HEADER_MsgType (mandatory)
  • MMS_HEADER_MmsVersion
nValue Based on the specified MMS header type, one of the following values:
Header
Value
nHeader = MMS_HEADER_ContentType
  • WAP_CONTENT_ApplicationVndWapMultipartMixed
  • WAP_CONTENT_ApplicationVndWapMultipartRelated
nHeader = MMS_HEADER_Date
Value equals the number of seconds from 1970-01-01, 00:00:00 GMT. 0 specifies the current date.
nHeader = MMS_HEADER_DeliveryReport
  • MMS_Yes

  • MMS_No

nHeader = MMS_HEADER_MsgClass
  • MMS_MSGCLASS_Personal
  • MMS_MSGCLASS_Advertisement
  • MMS_MSGCLASS_Informational
  • MMS_MSGCLASS_Auto
nHeader = MMS_HEADER_MsgType
  • MMS_M_SEND_REQ
  • MMS_M_SEND_CONF
  • MMS_M_NOTIFICATION_IND
  • MMS_M_NOTIFYRESP_IND
  • MMS_M_RETRIEVE_CONF
  • MMS_M_ACKNOWLEDGE_IND
  • MMS_M_DELIVERY_IND
nHeader = MMS_HEADER_MmsVersion
MMS_MSGVERSION_10
nHeader = MMS_HEADER_Priority
  • MMS_PRIORITY_Low
  • MMS_PRIORITY_Normal
  • MMS_PRIORITY_High
nHeader = MMS_HEADER_ReadReply
  • MMS_Yes

  • MMS_No

nHeader = MMS_HEADER_ReportAllowed
  • MMS_Yes

  • MMS_No

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");
    MmsAddFile(hMms, "info.gif", WAP_CONTENT_ImageGif, "", "info.gif");
    WapPostMms("http://10.5.8.12:8899/mmsc", hMms);
    MmsDeleteMms(hMms);
  end TInit;