mailtool_init

*//////////////////////////////////////////////////////////////*

* mailtool_init - Initialize MAILTOOL *

* *

* Output: *

* out_errMsg - The error message (if error exists). *

* *

* Returns: *

* -1 for error, 0 for no error. *

* *

*//////////////////////////////////////////////////////////////*

D mailtool_init...

D PR 10i 0

This function initializes the MAILTOOL function. It should be used as the first thing before setting variables or running the send email function.

When #mailtool_init() is called, the default values in the specified configuration file are used. These values can be overridden using the mailtool_setValue() function after the initialization has taken place.

The only value that can and should be set before calling the #mailtool_init() function are "configuration_file" and "ignore_blanks".

An example of a JSON configuration file is as follows:

{

"variables": [{

"name": "from_email",

"default": " "

}, {

"name": "from_name",

"default": " "

}, {

"name": "subject",

"default": " "

}, {

"name": "message",

"default": " "

}, {

"name": "reply_to_email",

"default": " "

}, {

"name": "reply_to_name",

"default": " "

}, {

"name": "mdn_email",

"default": " "

}, {

"name": "mdn_name",

"default": " "

}, {

"name": "sender_email",

"default": " "

}, {

"name": "sender_name",

"default": " "

}, {

"name": "footer_stream_file",

"default": " "

}, {

"name": "message_id",

"default": " "

}, {

"name": "message_id_domain",

"default": " "

}, {

"name": "send_with_server_type",

"default": "*IBMSMTP"

}, {

"name": "mail_router",

"default": "*NONE"

}, {

"name": "use_mail_router",

"default": "*NO"

}, {

"name": "perform_mx_lookup",

"default": "*YES"

}, {

"name": "use_ssl",

"default": "*NO"

}, {

"name": "smtp_port",

"default": "25"

}, {

"name": "smtp_auth_user",

"default": " "

}, {

"name": "smtp_auth_password",

"default": " "

}, {

"name": "bind_to_ip_address",

"default": " "

}, {

"name": "timeout",

"default": "30"

}, {

"name": "ccsid",

"default": "819"

}, {

"name": "no_attachment_action",

"default": " "

}, {

"name": "body_content_type",

"default": "text/plain"

}, {

"name": "mime_ccsid",

"default": "819"

}, {

"name": "temporary_directory",

"default": "/tmp"

}, {

"name": "importance",

"default": "normal"

}, {

"name": "priority",

"default": " "

}, {

"name": "recipient_separator",

"default": ","

}, {

"name": "close_connection",

"default": "*YES"

}, {

"name": "save_email",

"default": "*DFT"

}, {

"name": "debug",

"default": "*NO"

}, {

"name": "debug_file",

"default": "mailtooldebug_/%id%/.txt"

}, {

"name": "debug_smtp_file",

"default": "mailtoolsmtp_/%id%/.txt"

}

]

}