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 08/17/2020 at 09:10:28



Latest Posts:

Microsoft Office 365 Servers and Random Errors Issue Microsoft Office 365 Servers and Random Errors Issue
Posted by November 14, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Sending/Resending Emails Using a MIME File with MAILTOOL Sending/Resending Emails Using a MIME File with MAILTOOL
Posted by November 8, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Sending an HTML Email on Your IBM i Using MAILTOOL Sending an HTML Email on Your IBM i Using MAILTOOL
Posted by November 1, 2022
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Transferring License Keys from One System to Another Transferring License Keys from One System to Another
Posted by October 31, 2022
BVSTools >> BVSTools Software Discussion
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 (OAuth 2.0) or Microsoft Office 365? How Do I Switch From MAILTOOL Plus to GreenTools for Google (OAuth 2.0) 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

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).