|
The CONTENT_PART integer tag appears in taglists prepared for the SEND_MESSAGE
function, and in message taglists that are retrieved from a server using the GET_Q_ENTRIES_INFO
function. A message contains a separate section of tags, beginning
with the CONTENT_PART tag, for each
unique form of content that it contains, such as attachments and URLs.
The CONTENT_PART tag itself contains a value that
defines the purpose of the content, as either a cover graphic, cover text,
or attachment. Other tags in the CONTENT_PART section describe
the content's type, current storage location, and if available, original
name.
The CONTENT_PART tag can be set to one of the following values:
|
COVER_GRAPHIC |
1 |
Specifies a graphic for a cover |
|
COVER_TEXT |
2 |
Used to supply ASCII or Rich Text to be merged into a
cover |
|
ATTACHMENT |
3 |
Specifies a file or URL reference |
|
|
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);
} |