bvstone

GreenTools for Microsoft Apps (G4MS) v9.12 Now Includes Function to Send Emails using MIME File

Posted:

GreenTools for Microsoft Apps (G4MS) v9.12 Now Includes Function to Send Emails using MIME File

GreenTools for Microsoft Apps (G4MS) v9.12 now includes the function g4msmail_sendMailMime() which allows you to send an email using Office 365 from your IBM i with a pre-created MIME file.

Why is this important?  If you are making the move from your current email application, whether 3rd party or home grown, and you are using the QtmmSendMail API, you already have a MIME file created.  With this new function only small changes would be needed to your application in order to make the move to a more secure email system using Office 365 and Microsoft Graph APIs that unilize OAuth 2.0.

Note: As of this date, the email size limit is 4MB.  This is a known issue at MS and hopefully they are working on an update.

     H DFTACTGRP(*NO) BNDDIR('G4MS')
      ****************************************************************
      * Imports
      ****************************************************************
      /COPY QCOPYSRC,P.G4MSMAIL
      ****************************************************************
     D rc              S             10i 0
     D errorMsg        S            256
      ****************************************************************
      /free

       // Set the id of the account you wish to send an email from
       rc = g4msmail_setValue('id':'bvstone@bvstools.xxxxxxxx.com');
       rc = g4msmail_setValue('sendmail_mime_file':'/tmp/mimetestbig.txt');
       rc = g4msmail_setValue('debug':'*ALL');
       rc = g4msmail_sendMailMime(g4ms_uniqueID:errorMsg);

       if (errorMsg <> ' ');
         // do something if there is an error
       endif;

       EXSR $return;
       //***************************************************************
       //* Return
       //***************************************************************
       begsr $return;

         *INLR = *ON;
         return;

       endsr;

 


Last edited 08/13/2022 at 09:13:25




Reply




© Copyright 1983-2024 BVSTools
GreenBoard(v3) Powered by the eRPG SDK, MAILTOOL Plus!, GreenTools for Google Apps, jQuery, jQuery UI, BlockUI, TinyMCE and running on the IBM i (AKA AS/400, iSeries, System i).