|Version 2 (modified by AmigaPhil, 10 months ago) (diff)|
WriteAttach -- Attach a file to a new message.
Attaches a file to a new message.
FILE/A - filename to attach, with path
DESC - optional, string with a description for the file (V1.3)
ENCMODE - optional, encoding type for the file; may be either "uu" or "b64" (V1.3)
CTYPE - optional, content type of the file (V1.3)
RC is set to 10 if no Write window was previously specified as "active" with MAILWRITE ?.
By default, binary files are encoded as Base64 (MIME), whereas text files are UUencoded.
The default content type is taken after scanning the built-in list of MIME types and then looking at the MIME types defined in the user configuration. For instance, if the user has defined "application/pgs" as MIME type for files using the ".pgs" extension, all files attached bearing this extension will default to "application/pgs" unless CTYPE overrides this. If no suitable MIME type is found and no content type has been specified, YAM will fallback to "application/octet-stream".
/* Attach a file */
MAILWRITE WINDOW 0 /* Set the active Write window */
WRITEATTACH 'Docs:Mag.pgs' ENCMODE 'b64' CTYPE 'application/pgs'
No error is returned if the specified file was found but couldn't be opened.