CONTENT_TYPE

CAS Tags

The CONTENT_TYPE integer tag appears in CONTENT_PART sections of message taglists, for messages prepared for the SEND_MESSAGE function, and messages retrieved from the server with the GET_Q_ENTRIES_INFO function.  This tag defines the data type of the content.  When a new message is submitted with the SEND_MESSAGE function, the server will attempt to verify the content of all attachments, thus if you are uncertain about the type of a file it is acceptable to identify it as UNKNOWN.

The CONTENT_TYPE tag can be set to one of the following values:
UNKNOWN 0 Used for most attachments
ASCII 1 Plain Text ASCII
PCX 2 PCX (Easily Auto detected type)
DCX 3 DCX (Easily Auto detected type)
TIFF 4 TIFF (All formats)  (Easily Auto detected type)
TIFF1D 5 TIFF Class F 1D (Easily Auto detected type)
TIFF2D 6 TIFF Class F 2D (Easily Auto detected type)
T6 7 FAX T6 Raw
RAW_RTF 8 Standard Rich Text
TNEF 9 MAPI Encoded Data
X209 10 X209 Encoded
PS 11 Postscript
HTML 12 Required for URL Faxing
PCL 13 Required for PCL Add-On Faxing

 
  Type Max Size Multiple Allowed
Integer 4 bytes Yes, but only one per CONTENT_PART section.

Example:
function SendFaxAttachments()
  {
  var Tl, StatusNum;
  
  Tl = CAS.New();
  CAS.AddTag(Tl,"SEND_MESSAGE","");
  CAS.AddTag(Tl,"REGISTERED_NAME",UserName);
  CAS.AddTag(Tl,"REGISTERED_PASSWORD",UserPassword);
  CAS.AddTag(Tl,"TRANSFER_TYPE",0);  // 1= EMAIL, 0=FAX
  CAS.AddTag(Tl,"SUBJECT","Subject");

  Sl = CAS.CreateSection(Tl,"RECEIVER_ADDRESS","555-123-1234");
    CAS.AddTag(Sl,"RECEIVER_NAME","Recipient");
  CAS.CloseSection(Sl);
  
    // Send an ASCII cover message

  Sl = CAS.CreateSection(Tl,"CONTENT_PART",2);
    CAS.AddTag(Sl,"CONTENT_TYPE",1);
    CAS.AddTag(Sl,"CONTENT_DATA","This is my cover text!");
  CAS.CloseSection(Sl);

    // Send a web page by referencing a URL.  The CONTENT_TYPE
    // is set to HTML, but COPY_ATTACHMENT is 0 so the
    // CURRENT_FILESPEC is treated as a URL, not a file name.

  Sl = CAS.CreateSection(Tl,"CONTENT_PART",3);
    CAS.AddTag(Sl,"CONTENT_TYPE",12);
    CAS.AddTag(Sl,"ORIGINAL_FILENAME","anything.html");
    CAS.AddTag(Sl,"CURRENT_FILESPEC", "http://www.faxback.com");
    CAS.AddTag(Sl,"COPY_ATTACHMENT",0);
  CAS.CloseSection(Sl);

    // Send a Word .DOC file

  Sl = CAS.CreateSection(Tl,"CONTENT_PART",3);
    CAS.AddTag(Sl,"CONTENT_TYPE",0);
    CAS.AddTag(Sl,"ORIGINAL_FILENAME","TestFile.doc");
    CAS.AddTag(Sl,"CURRENT_FILESPEC", "c:\\temp\\TestFile.doc");
    CAS.AddTag(Sl,"COPY_ATTACHMENT",1);
  CAS.CloseSection(Sl);

    // Send message on this already open session
  Tl = CAS.Send(cInst,Tl);
  StatusNum = parseInt(CAS.GetTag(Tl,"STATUS_NUM",0));
  CAS.Delete(Tl);
  
  return(StatusNum);
  }

See Also:
SEND_MESSAGE, CONTENT_PART, ORIGINAL_FILENAME, CURRENT_FILESPEC, COPY_ATTACHMENT