bvstone

Resending Emails that have Errored Out with Updated Router or Authentication Information

Posted:

Resending Emails that have Errored Out with Updated Router or Authentication Information

There are times when you will send emails from your IBM i, and for one reason or another (your quota was reached, your internet was down, etc) you may have a large group of emails that are not delivered and need to be resent.

Normally you could use the MTPLUGLOG command to resend individual emails, or the MTPRESEND command to resend all errored email messages at once.

But there may be a case, such as in the case of your sending quotas going over the limit, where you would need to change the email router and/or authentication information to resend the email.

When an email errors out with MAILTOOL (and MAILTOOL Plus), the email (MIME file) itself is saved in the IFS along with a unique JSON configuration for that email.  The details of the FROM address and TO, CC and BCC recipients are also stored in the MAILTOOL log files. 

One option is to edit each of the configuration files and manually change the information you need (router, user, password, etc) but when you have hundreds or thousands of emails to resend that is an overwhelming task.

Instead, when resending emails using either MTPLUSLOG or MTPRESEND, you have the option to specify a different and specific JSON configuration file.

                     MAILTOOL Plus Resend (MTPRESEND)                        

Type choices, press Enter.                                          
Send to All Recipients . . . . .   *ERR          *ERR, *YES        
Configuration File . . . . . . .   *DFT                            
Prompt Before Running  . . . . .   *YES          *YES, *NO

In this example, *DFT is specified for the configuration file.  This tells MAILTOOL to use the configuration file that was created during sending of the email when it errored out to resend.  But, we can override this parameter with a specific configuration file we can create manually and have that applied to all of the emails that are resent.

Let's assume we create an IFS file named /tmp/tempemail.json, and use the following settings:

{  
   "variables":[  
      {  
         "name":"from_email",
         "default":"<your from address>"
      },
      {  
         "name":"send_with_server_type",
         "default":"*MAILTOOL"
      },
      {  
         "name":"mail_router",
         "default":"smtp.gmail.com"
      },
      {  
         "name":"use_mail_router",
         "default":"*ONLY"
      },
      {  
         "name":"use_ssl",
         "default":"*YES"
      },
      {  
         "name":"smtp_port",
         "default":"465"
      },
      {  
         "name":"smtp_auth_user",
         "default":"<smtp auth user id>"
      },
      {  
         "name":"smtp_auth_password",
         "default":"<smtp_password>"
      }
   ]
}

You would need to replace items  in < > with the correct information.  The FROM address is required, but won't be changed, even if what you use is different from the original email as the FROM address and recipients are taken from the MAILTOOL log files and already in the MIME file itself.  But, the mail router, port, SSL setting, and authentication parameters can be overridden with new values that WILL be replaced when sending the email.

It is STRONGLY advised, once you create the JSON configuration file, that you could then run one or more tests from MTPLUSLOG making sure to override the configuration file with the one you created.  If it works, you should be able to use MTPRESEND and also override the configuration file with the one you created.


Last edited 03/01/2019 at 12:04:36



Latest Posts:

MAILTOOL Updated to Allow G4GSMAIL as Option in Routers File MAILTOOL Updated to Allow G4GSMAIL as Option in Routers File
Posted by 3 days ago
BVSTools >> BVSTools Announcements >> eMail Tool (MAILTOOL) Specific Announcements
BVSTools Now Offers Interface with Infor's ION APIs BVSTools Now Offers Interface with Infor's ION APIs
Posted by May 15, 2020
BVSTools >> BVSTools Announcements
More V7R4 IFS File CCSID Issues and The Fix More V7R4 IFS File CCSID Issues and The Fix
Posted by March 4, 2020
IBM Power Systems >> (QGPL) IBM i
Error Retrieving IP Address by Name Error Retrieving IP Address by Name
Posted by February 25, 2020
BVSTools >> BVSTools Software Discussion
Logging jobs that hit an outq Logging jobs that hit an outq
Posted by February 13, 2020
Programming >> CL Programming
GreenTools for Google Apps (G4G) v12.60 Released with Shared Drive Features and More... GreenTools for Google Apps (G4G) v12.60 Released with Shared Drive Features and More...
Posted by February 4, 2020
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
Allowing Requests over Port 80 For SSL Validation (ie, Namecheap, etc) Allowing Requests over Port 80 For SSL Validation (ie, Namecheap, etc)
Posted by January 31, 2020
Programming >> Web Programming
GreenTools for Slack (G4SLK) v3.00 Released GreenTools for Slack (G4SLK) v3.00 Released
Posted by January 17, 2020
BVSTools >> BVSTools Announcements >> GreenTools for Slack (G4SLK) Specific Announcements
Calling a QSH Command from RPG Calling a QSH Command from RPG
Posted by December 26, 2019
Programming >> RPG Programming
SPLTOOL Print Range (PRTRNG) Function Updated to Handle Spooled Files up to 999,999,999 Pages SPLTOOL Print Range (PRTRNG) Function Updated to Handle Spooled Files up to 999,999,999 Pages
Posted by December 14, 2019
BVSTools >> BVSTools Announcements >> Spooled File Tools (SPLTOOL) Specific Announcements
GreenTools for Microsoft Apps (G4MS) Updated to v6.00 - Now Uses Microsoft Graph APIs GreenTools for Microsoft Apps (G4MS) Updated to v6.00 - Now Uses Microsoft Graph APIs
Posted by November 24, 2019
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
V7R4 Changes CCSID of Compressed File Using PASE JAR Command - Here's The Fix V7R4 Changes CCSID of Compressed File Using PASE JAR Command - Here's The Fix
Posted by November 21, 2019
IBM Power Systems >> (QGPL) IBM i
Using GETURI to Make OAuth 2.0 Requests - Custom Headers for Access Tokens Using GETURI to Make OAuth 2.0 Requests - Custom Headers for Access Tokens
Posted by November 11, 2019
BVSTools >> BVSTools Software Discussion >> Get URI (GETURI) Specific Discussion
GreenTools for Microsoft Apps (G4MS) v5.00 Released with Updated OneDrive Support and 3rd Party Functionality GreenTools for Microsoft Apps (G4MS) v5.00 Released with Updated OneDrive Support and 3rd Party Functionality
Posted by October 20, 2019
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
BVSTools is Now Running V7R4M0 BVSTools is Now Running V7R4M0
Posted by September 28, 2019
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).