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:

BVSTools Now Offers Vertex Cloud Interface BVSTools Now Offers Vertex Cloud Interface
Posted by April 15, 2019
BVSTools >> BVSTools Announcements
Token Has an Invalid Signature Error for Office 365 Email Token Has an Invalid Signature Error for Office 365 Email
Posted by March 22, 2019
BVSTools >> BVSTools Software Discussion >> GreenTools for Microsoft Apps (G4MS) Specific Discussion
Resending Emails that have Errored Out with Updated Router or Authentication Information Resending Emails that have Errored Out with Updated Router or Authentication Information
Posted by March 1, 2019
BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
BVSTools Offers Toolset to Work With HubSpot OAuth 2.0 APIs On Your IBM i BVSTools Offers Toolset to Work With HubSpot OAuth 2.0 APIs On Your IBM i
Posted by January 27, 2019
BVSTools >> BVSTools Announcements
G4MSDRV Currently Not Supported G4MSDRV Currently Not Supported
Posted by January 17, 2019
BVSTools >> BVSTools Announcements >> GreenTools for Microsoft Apps (G4MS) Specific Announcements
Removing Trailing Carriage Returns and/or Line Feeds from a String with RPG Removing Trailing Carriage Returns and/or Line Feeds from a String with RPG
Posted by December 26, 2018
Programming >> RPG Programming
Create QRCODE in DDS Create QRCODE in DDS
Posted by September 21, 2018
Programming >> RPG Programming
Base64 Encoding a File with RPG Base64 Encoding a File with RPG
Posted by September 6, 2018
Programming >> RPG Programming
Building JSON with RPG and YAJL and Writing to Standard Output Building JSON with RPG and YAJL and Writing to Standard Output
Posted by August 31, 2018
Programming >> Proof of Concept (POC)
How to Delete Files or Empty Trash From Your Google Drive with your IBM i and RPG/ILE How to Delete Files or Empty Trash From Your Google Drive with your IBM i and RPG/ILE
Posted by July 24, 2018
BVSTools >> BVSTools Software Discussion >> GreenTools for G Suite (Google Apps) (G4G) Specific Discussion
GreenTools for G Suite (G4G) Updated to Include Delete and Empty Trash Function GreenTools for G Suite (G4G) Updated to Include Delete and Empty Trash Function
Posted by July 24, 2018
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
What to Do If Your License Keys Don't Work What to Do If Your License Keys Don't Work
Posted by July 18, 2018
BVSTools >> BVSTools Software Discussion
MAILTOOL Updated to Allow Failed Message on Invalid Recipient MAILTOOL Updated to Allow Failed Message on Invalid Recipient
Posted by May 20, 2018
BVSTools >> BVSTools Announcements >> eMail Tool (MAILTOOL) Specific Announcements
Non HTTPS Callbacks Removed from GreenTools for G Suite (G4G) Non HTTPS Callbacks Removed from GreenTools for G Suite (G4G)
Posted by April 15, 2018
BVSTools >> BVSTools Announcements >> GreenTools for G Suite (Google Apps) (G4G) Specific Announcements
IBM i Related Survey Available IBM i Related Survey Available
Posted by April 7, 2018
IBM Power Systems >> (QGPL) IBM i

Reply




Copyright 1983-2019 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).