Script functions reference > Script functions in alphabetical order > M > MIMEAddPart

MIMEAddPart
Syntax
MIMEAddPart(FileName,PartType);
FileName
PartType
Description
This script function is called from a Before Process script, and adds a file on the local file system to the output connector connected to the Process. The file added can be used as a regular attachment, a MIME body part or alternative body part.
Note that the output connector must support attachments for this script function to be of any use. Currently the SMTP (MIME) connector is the only connector that supports attachments.
Returns
A number representing success or failure.
>0
OK, i.e. the part is created. The returned number can be used as Key in subsequent calls to the MIMESetPartProperty script function.
-1
-2
-3
-4
Invalid FileName.
-5
Invalid PartType.
Example
switch ($category)
{
 case "Gold":
  MIMEAddPart("C:\att\gold.pdf", 0);
 break;
 case "Silver":
  MIMEAddPart("C:\att\silver.pdf", 0);
 break;
 case "Bronze":
  MIMEAddPart("C:\att\bronze.pdf", 0);
 break;
 default:
  MIMEAddPart("C:\att\standard.pdf", 0);
}
OpenText StreamServe 5.6 Updated: 2013-03-01