#g4gmail_getAttachment

      *//////////////////////////////////////////////////////////////*
      * #g4gmail_getAttachment - Retrieve the email attachment.      *
      *                           This will update the attachment    *
      *                           location field in the G4GMPPF file.*
      *                                                              *
      * Output:                                                      *
      *   out_errMsg - The error message (if error exists).          *
      *                                                              *
      * Returns:                                                     *
      *   -1 for error, 0 for success                                *
      *                                                              *
      * Settable Variables ([r]=required)                            *
      *   id - Google ID [r]                                         *
      *   message_id - Message ID [r]                                *
      *   attachment_id - Attachment ID [r]                          *
      *   attachment_mimetype - Attachment Mime Type                 *
      *   temp_dir - Temporary Directory for attachment files (/tmp) *
      *   ccsid - The CCSID to use (1208)                            *
      *   debug - Turn on Debug (*NO, *YES)                          *
      *   debug_file - The debug file name.                          *
      *                 (/tmp/g4g_[id]_[msgid]_getAttachment.txt)    *
      *                                                              *
      *//////////////////////////////////////////////////////////////*
     D #g4gmail_getAttachment...
     D                 PR            10i 0
     D  out_errMsg                  256    Options(*NOPASS)

#g4gmail_getAttachment will retrieve the attachment associated with a specific message.  This is called internally by the #g4gmail_listMessages procedure.

Returns: 0 for success or -1 for error.

Optional Parameters:
  • Error Message (output) - Error message  
Settable Variables (use #g4gmail_setValue):
  • id (required) - Your Google ID
  • message_id (required) - The message ID of the message to retrieve.
  • attachment_id (required) - The attachment ID of the message to retrieve.  This is located in the G4GMPPF field in the G4GMPPF file.
  • attachment_mimetype - Specify the mime type of the attachment.  This is used to determine the extension of the file when it is placed in the IFS.  The list of types and extensions can be found in the G4GCTTPF file.
  • temp_dir - Specify the fully qualified path to the directory where you wish the attachments to be placed in.  The default is /tmp.
  • ccsid - The CCSID to use.  The default is 1208.
  • debug - Specify *YES to turn on debug, or *NO to turn off debug.  The default is *NO.
  • debug_file - Specify the fully qualified file name for the main debug file.  The default is /tmp/g4g_[id]_[msgid]_getAttachment.txt.
Comments