bvstone

GreenTools for G Suite (G4G) Now Includes Send Mail Functionality (G4GSMAIL Addon)

Posted:

GreenTools for G Suite (G4G) Now Includes Send Mail Functionality (G4GSMAIL Addon)

Update: 08/28/2019 - Google has verified the G4GSMAIL Addon

=========================================================

If you read the recent FieldExit article regarding Google updating their Privacy Policy and basically locking down certain APIs and scopes, you'll know that we were looking for a way to still allow the functionality of sending emails using GMail or G Suite with OAuth 2.0.

We recently updated GreenTools for G Suite (G4G) to include functions in the F.G4GMAIL service program that will allow you to send emails via Google's RESTful API interface.

We have also added functionality to MAILTOOL that will allow you to send using this method.  Simply register the service for your G Suite or GMail account and use the SENDWITH(*G4GSMAIL) option.

You can also use this functionality in your own programs using the g4gmail_sendMail() function.  Here is the prototype:

 *//////////////////////////////////////////////////////////////*       
 * g4gmail_sendMail - Send an Email using Gmail API             *       
 *                                                              *       
 * Output:                                                      *       
 *   out_id - The ID of the email message (if successful).      *       
 *   out_threadID - The Thread ID of the email message.         *       
 *   out_errMsg - The error message (if error exists).          *       
 *                                                              *       
 * Returns:                                                     *       
 *   -1 for error, 0 for success                                *       
 *                                                              *       
 * Settable Variables ([r]=required)                            *       
 *   id - Google ID [r]                                         *       
 *   sendmail_mime_file - The fully qualified path to the MIME  *       
 *    file of the email you want to send. [r]                   *       
 *   message_id - The message/thread ID to apply to this email. *       
 *   ccsid - The CCSID to use (1208)                            *       
 *   debug - Turn on Debug (*NO, *YES)                          *  
 *                                                              *  
 *//////////////////////////////////////////////////////////////*  
D g4gmail_sendMail...                                             
D                 PR            10i 0                              
D  out_id                      256    Options(*NOPASS)             
D  out_threadID                256    Options(*NOPASS)             
D  out_errMsg                  256    Options(*NOPASS)                  

All you need to provide is a properly formatted MIME file in the IFS and the API will do the rest.  Or, if you don't have any applications that create email MIME files the MAILTOOL application can do that heavy lifting for you.  

If you are using a 3rd party or open source email application this function will make it easy to simply plug this into your application and start using GMail functionality with your applications.

Using this application does require licensing of GETURI, the G4G base product and the G4GSMAIL addon.  If you wish to use it with MAILTOOL you will need a license for that as well.  But you will not require a MAILTOOL Plus license unless you require the functionality offered by the Plus Addon.

Google does enforce a 35MB maximum size for the entire message (after it's base 64 encoded).  That size limit is checked by G4G before attempting to call the API.  

You can see a video of the process on YouTube by clicking here.

As always, feel free to contact us with any questions.

 


Last edited 03/04/2022 at 09:55:13



Latest Posts:

Calculating the Size of a File Before Base64 Encoding Calculating the Size of a File Before Base64 Encoding
Posted by August 13, 2022
Programming >> RPG Programming
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 Function to Send Emails using MIME File
Posted by August 11, 2022
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
GreenTools for Google Apps (G4G) v15.20 Now Supports Shortcuts GreenTools for Google Apps (G4G) v15.20 Now Supports Shortcuts
Posted by August 6, 2022
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
GreenTools for Microsoft Apps (G4MS) Groups Admin Authority Instructions GreenTools for Microsoft Apps (G4MS) Groups Admin Authority Instructions
Posted by July 26, 2022
BVSTools >> BVSTools Software Discussion >> GreenTools for Microsoft Apps (G4MS) Specific Discussion
GreenTools for Microsoft Apps (G4MS) v9.10 Now Includes OneDrive Functions that Work With Groups/Shared Drives GreenTools for Microsoft Apps (G4MS) v9.10 Now Includes OneDrive Functions that Work With Groups/Shared Drives
Posted by July 19, 2022
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
GreenTools for Google Apps (G4G) v15.10 Now Includes Drive Functions that Work With Shared Drives GreenTools for Google Apps (G4G) v15.10 Now Includes Drive Functions that Work With Shared Drives
Posted by July 15, 2022
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
GreenTools for Microsoft Apps (G4MS) v9.00 Now Offers Functions to Bypass Registration Command and BVSTools Landing Page GreenTools for Microsoft Apps (G4MS) v9.00 Now Offers Functions to Bypass Registration Command and BVSTools Landing Page
Posted by July 4, 2022
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
What Objects Should I Omit from Replication to Ensure My License Keys Work on my HA/DR System? What Objects Should I Omit from Replication to Ensure My License Keys Work on my HA/DR System?
Posted by June 27, 2022
BVSTools >> BVSTools Software Discussion
GreenTools for Google Apps (G4G) v15.00 Now Offers Functions to Bypass Registration Command and BVSTools Landing Page GreenTools for Google Apps (G4G) v15.00 Now Offers Functions to Bypass Registration Command and BVSTools Landing Page
Posted by May 3, 2022
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
How Do I Switch From MAILTOOL Plus to GreenTools for Google or Microsoft Office 365? How Do I Switch From MAILTOOL Plus to GreenTools for Google or Microsoft Office 365?
Posted by April 18, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
PTFs Issued for SSL/TLS Issues PTFs Issued for SSL/TLS Issues
Posted by March 12, 2022
IBM Power Systems >> PTF Watch
Google Dropping Support for Google Dropping Support for "Less Secure Apps" May 30th, 2022. What Does This Mean for Your IBM i Email?
Posted by March 4, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Have You Installed a New Version of MAILTOOL and Now Things Are Acting Different?  Check the Command Defaults! Have You Installed a New Version of MAILTOOL and Now Things Are Acting Different? Check the Command Defaults!
Posted by February 28, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Using MAILTOOL Plus on V7R1, or Any OS Using TLS 1.1 or Older Using MAILTOOL Plus on V7R1, or Any OS Using TLS 1.1 or Older
Posted by January 27, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
BVSTools ILE Functions Being Updated to Remove Hashtag (#) from Function Names BVSTools ILE Functions Being Updated to Remove Hashtag (#) from Function Names
Posted by December 30, 2021
BVSTools >> BVSTools Announcements

Reply




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