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

MIMEAddPart
Syntax
MIMEAddPart(Resource,PartType);
Resource
C:\attachments\gold.pdf
otmm://gbg/?id=6708ba967b9b4dbd94f01fd6457a781c3e98e173
resource:/?name=offer
PartType
Description
This script function is called from a Before Process script, and adds a resource to the output connector connected to the Process. The resource can be used as an attachment, a body or alternative body.
Note that the output connector must support attachments for this script function to be of any use. Currently only the SMTP (MIME) and EasyLink Email connectors support attachments.
To be able access OTMM assets you must first create a Media Management connection profile (see the Profile configurations documentation). When you have the connection profile you can reference an asset using the following syntax:
otmm://<profileName>/<reference>
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 Resource.
-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.2 Updated: 2018-01-26