Script functions reference > Script functions in alphabetical order > A > AttachmentBegin

AttachmentBegin
Syntax
AttachmentBegin();
Description
The AttachmentBegin and AttachmentEnd script functions define the beginning and end of an attachment:
The AttachmentBegin script function is normally called from a Before Process script on the first Process to include in an attachment.
The AttachmentEnd script function ends the AttachmentBegin function, and is called from an After Process script on the last Process to include in an attachment.
The attachment can be added to an email sent via a email output connector, for example an SMTP (MIME) output connector.
To be able to add the attachment to the email, the attachment must be finished before the email is sent via the email output connector. When the attachment has to be finished depends on the output mode defined for the email connector.
The mail is sent when the Process that invokes the email connector is completed. Any attachment intended for the current email must be created before that time, i.e. all attachments from other Processes must be run before the email connector Process is run.
The email is sent when the document ends, i.e. the document containing the Process that invoked the email connector. Any attachment intended for the current email must belong to a Process run before the email connector Process, or after the email connector Process but before the document trigger changes value.
Any attachment from Processes within the same job as the email connector Process can be attached to the email connector output.
Example
Before Process script defining the beginning of the attachment:
$attatchmentfile = AttachmentBegin();
After Process script defining the end of the attachment:
AttachmentEnd($attachmentfile);
To add the attachment to an email, $attatchmentfile is used as file name.
OpenText StreamServe 5.6 Updated: 2013-03-01