MmsSetHeaderString Function

Action

Sets a MMS header. Based on the specified MMS type (MmsSetHeader) the listed headers are either mandatory or optional. See the MMS Encapsulation Protocol specification for details.

Include file

MmsLib.bdh

Syntax

MmsSetHeaderString( in hMms    : number,
                    in nHeader : number,
                    in sValue  : string ): 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_Bcc
  • MMS_HEADER_Cc
  • MMS_HEADER_ContentLocation
  • MMS_HEADER_From
  • MMS_HEADER_MsgId
  • MMS_HEADER_Subject
  • MMS_HEADER_To
  • MMS_HEADER_TransactionId
sValue Based on the specified header type, the sValue parameter specifies one of the following:
  • MMS_HEADER_Bcc: An MMS address (phone number, e-mail address, IP address).
  • MMS_HEADER_Cc: An MMS address (phone number, e-mail address, IP address).
  • MMS_HEADER_ContentLocation: Content location of the MMS.
  • MMS_HEADER_From: An MMS address (phone number, e-mail address, IP address).
  • MMS_HEADER_MsgId: The message ID.
  • MMS_HEADER_Subject: The message subject.
  • MMS_HEADER_To: An MMS address (phone number, e-mail address, IP address).
  • MMS_HEADER_TransactionId: The transaction ID.

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;