Forums >> BVSTools >> BVSTools Software Discussion >> Email Tools (MAILTOOL) Specific Discussion
Setting Defaults for MAILTOOL and SPLTOOL to use MAILTOOL Plus
by: bvstone

Jump to: 






bvstone

Setting Defaults for MAILTOOL and SPLTOOL to use MAILTOOL Plus

Posted:
Setting Defaults for MAILTOOL and SPLTOOL to use MAILTOOL Plus

We're often presented with an issue from customers switching from using the standard MAILTOOL command to using MAILTOOL Plus what the best approach is.

A lot of them have hundreds of programs with the MAILTOOL command in them and changing all of them can be daunting to say the least.

There are really two ways to tackle this:

The Change Command Default (CHGCMDDFT) Command and MAILTOOL Plus Parameters

Well, since MAILTOOL (and SPL2EMAIL if you're using that) are commands, then you can use the good old Change Command Default (CHGCMDDFT) command to change the defaults for the appropriate parameters.  (Of course, if you've hard-coded these in the programs this won't work and you'll need to go through each program and fix things.)

The following command will change the defaults for MAILTOOL (and SPLTOOL) to use MAILTOOL Plus as the default.  If you also require the use of SSL/TLS and/or userid and password, those parameters also can be changed.

CHGCMDDFTCMD(MAILTOOL) NEWDFT('SENDWITH(*MAILTOOL)')
CHGCMDDFTCMD(MAILTOOL) NEWDFT('MAILRTR(''xx.xx.xx.xx'')')
CHGCMDDFTCMD(MAILTOOL) NEWDFT('USERTR(*ONLY)')

CHGCMDDFTCMD(SPL2EMAIL) NEWDFT('SENDWITH(*MAILTOOL)')
CHGCMDDFTCMD(SPL2EMAIL) NEWDFT('MAILRTR(''xx.xx.xx.xx'')')
CHGCMDDFTCMD(SPL2EMAIL) NEWDFT('USERTR(*ONLY)')

CHGCMDDFTCMD(SPL2EMAILB) NEWDFT('SENDWITH(*MAILTOOL)')
CHGCMDDFTCMD(SPL2EMAILB) NEWDFT('MAILRTR(''xx.xx.xx.xx'')')
CHGCMDDFTCMD(SPL2EMAILB) NEWDFT('USERTR(*ONLY)')

Once done, all the commands that don't have SENDWITH, MAILRTR and USERTR defined will now use these new defaults.

One thing to look out for is if you do upgrade versions of MAILTOOL or SPLTOOL, the commands will default back to their original values and these commands will need to be run again.  That's just how things work with IBM commands.

Using Configuration Files and CHGCMDDFT

Another option is to use configuration files to set these values.  You could create a default configuration file to be used and use the CHGCMDDFT command again to the value of that configuration file.

CHGCMDDFT CMD(MAILTOOL) NEWDFT('CONFIG(''/path/myconfigfile.json'')')

CHGCMDDFT CMD(SPL2EMAIL) NEWDFT('CONFIG(''/path/myconfigfile.json'')')

CHGCMDDFT CMD(SPL2EMAILB) NEWDFT('CONFIG(''/path/myconfigfile.json'')')

Now, the configuration file you're using can specify a value in the configuration file for pretty much any other parameter on the command (except the recipients, subject, message and attachments).   This means setting the mail router, send with, use router, smtp user id and password, SSL/TLS settings, etc are all there in a simple JSON file.

In the long run, this is probably the best option as the configuration files really make updating settings for the commands simple and straightforward.

 


Last edited 02/10/2015 at 13:58:01




Reply




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