MAILTOOL FAQ

Following are some of the frequently asked questions about MAILTOOL. When reporting problems, please send them via email stating the problem. Let me know what version of MAILTOOL you are using. See the main FAQ for instructions on finding the version you currently have installed.

In face, we have introduced new features in MAILTOOL that allow you to bypass the Not Trusted errors so that you don't need to import new CAs ever time.


                                             Additional Message Information                                                                        

 Message ID . . . . . . :   CPA5305       Severity . . . . . . . :   99       

 Message type . . . . . :   Inquiry                                           

 Date sent  . . . . . . :   04/27/15      Time sent  . . . . . . :   08:01:13 

                                                                               

 Message . . . . :   Record not added. Member MLTLOGDPF is full. (C I 9999)   

 Cause . . . . . :   The maximum size has been reached for member MLTLOGDPF   

   file MLTLOGDPF in library MAILTOOL.  The record format is FORMAT0001 and the

   member number is 1.                                                        

 Recovery  . . . :   Enter one of the following:                              

     C -- To cancel the request.                                              

     I -- To ignore this message, increase the file size by one increment, and

   add the record to the file.                                                 

     1-9999 -- To ignore this message, increase the file size by the specified

   number of increments, and add the record to the file.                      

 /COPY QCOPYSRC,P.MAILTOOL     

 ******************************************************************** 

D rc              S             10i 0                                               

D errMsg          S            256                                                  

 ********************************************************************

 /free                                                                       

                                                                                                       

  if (#mailtool_init() >= 0);  

    rc = #mailtool_setValue('configuration_file':<your config file>); 

    rc = #mailtool_loadDefaults();

    // if you're not using a config file, set the from address:

    #mailtool_setValue('from_email':'johndoe@mycompany.com');

    #mailtool_setValue('subject':'test email');                         

    #mailtool_setValue('message':'this is the message \n\n newline.');  

    #mailtool_addTORecipient('james@thegiantpeach.com');                      

    rc = #mailtool_sendMail(errMsg);  

  endif;                

                        

  *INLR = *ON;          

                        

 /end-free             


          Following is a small example of how this can be done with QCMDEXC:

D Subject         S           1024

D Message         S           2048

D ToAddr          S            128

D FromAddr        S            128

D QCmdCmd         S          32702    INZ

D QCmdLength      S             15  5 INZ(%size(QCmdCmd))

C                   eval      Subject ='This is the subject'

C                   eval      Message = 'This is the message'

C                   eval      ToAddr = 'someone@somewhere.com'

C                   eval      FromAddr = 'me@myhome.com'

 *

C                   eval      QCmdCmd = 'MAILTOOL ' +

C                                       'TOADDR(''' +

C                                       %trim(ToAddr) +

C                                       ''') ' + 

C                                       'FROMADDR(''' +

C                                       %trim(FromAddr) + 

C                                       ''') ' +

C                                       'SUBJECT(''' +

C                                       %trim(subject) + ''') ' +

C                                       'MESSAGE(''' +

C                                       %trim(message) +

C                                       ''') '

 *

 * If you're using MAILTOOL Plus you can also add the following:

C*                                      'SENDWITH(*MAILTOOL) ' +

C*                                      'MAILRTR(''your.mail.router'') ' +

C*                                      'USERTR(*ONLY)'

 *

C                   CALL      'QCMDEXC'                            99

C                   PARM                    QCmdCmd

C                   PARM                    QCmdLength

MAILTOOL uses the QtmmSendMail API which is part of MSF. This requires OS/400's SMTP server. MAILTOOL will work as is if you are using OS/400's SMTP server. If you are using Domino's SMTP server then you will need to run dual stack (both SMTP servers) and it will work fine.

Another option is to use the MAILTOOL Plus! Addon which can send emails independant of any other server. You can try the MAILTOOL Plus! addon by simply requesting a key from me. The MAILTOOL Plus! Addon allows you to completely bypass the IBM SMTP server and send mail directly to your mail router, or the Internet (depending on how your network is set up.)

First, you need to make sure you're using MAILTOOL Plus and specifying the right parameters:

If this still doesn't work and you receive errors like this in the job log:

Error performing SSL handshake.  There is no error.   RC(23) errno().     

Error sending email.                                                      

This means that you don't have the proper Certificate Authorities installed on your machine to communicate with Google's SMTP server.  Click Here to download the certificate authorities used by GMail, then follow the directions on this site to install them into the *SYSTEM store.  You will import google1.cer first, then google2.cer into the *SYSTEM store.

CHGCMDDFT CMD(MAILTOOL) NEWDFT('SENDWITH(*MAILTOOL)')

CHGCMDDFT CMD(MAILTOOL) NEWDFT('MAILRTR(xx.xx.xx.xx)')

CHGCMDDFT CMD(MAILTOOL) NEWDFT('USERTR(*ONLY)')

CHGCMDDFT CMD(SPL2EMAIL) NEWDFT('SENDWITH(*MAILTOOL)')

CHGCMDDFT CMD(SPL2EMAIL) NEWDFT('MAILRTR(xx.xx.xx.xx)')

CHGCMDDFT CMD(SPL2EMAIL) NEWDFT('USERTR(*ONLY)')

CHGCMDDFT CMD(SPL2EMAILB) NEWDFT('SENDWITH(*MAILTOOL)')

CHGCMDDFT CMD(SPL2EMAILB) NEWDFT('MAILRTR(xx.xx.xx.xx)')

CHGCMDDFT CMD(SPL2EMAILB) NEWDFT('USERTR(*ONLY)')