AddAttachmentFromFile

Add a file attachment to the message.

AddAttachmentFromFile (FilePath , OptionList)

Parameters

Parameter Type Direction Description
FilePath string In File name with complete path; maximum of 1024 bytes
OptionList string In Associative list of key-value pairs, to a maximum of 10240 bytes. Currently, the only valid key is MIMEType, which can be set to the correct media MIME type for the attachment. If omitted, the file extension is used to determine the MIME type. If the file has an unknown extension, application/octet-stream is used.

Return Values

Values returned in $status
Value Description
0 Operation succeeded.
-13 File open error.
-14 MIME encoding failed
-18 Memory allocation error
<0 An error occurred

Description

To add multiple file attachments, call this operation for each attachment.

variables
    handle mailApiHandle
endvariables

; create the instance handle
newinstance "UPOPMAIL", mailApiHandle

...
mailApiHandle->AddAttachmentFromFile($Attachment1$, "")
mailApiHandle->AddAttachmentFromFile($Attachment2$, "")