g4msmail_sendMail

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

* g4msmail_sendMail - Send the Email *

* *

* Output: *

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

* *

* Returns: *

* -1 for error, 0 for success. *

* *

* Settable Variables ([r]=required) *

* id - MS ID [r] *

* subject - Email Subject *

* message - Email Message *

* The special value of *STMF can be used to load *

* the email message from a stream file. *

* message_stream_file - If *STMF is used for the value of *

* message, this should contain the *

* fully qualified path to the stream *

* file containg the message. *

* message_content_type - The content type of the message *

* body. Valid values: *

* TEXT *

* HTML *

* save_to_sent_items - Whether or not this message should be *

* saved to the sent folder. *

* Valid Values: *

* true *

* false *

* reset - Reset Values when Done (*YES) *

* ccsid - The CCSID to use (1252) *

* debug - Turn on Debug (*NO, *YES) *

* debug_file - The debug file name. *

* (/tmp/g4ms_[id]_sendMail.txt) *

* *

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

D g4msmail_sendMail...

D PR 10i 0

D out_errMsg 256 Options(*NOPASS)

g4msmail_sendMail is used to send an email using the G4MSMAIL functions.

When the email is sent, or an error occurs after the creation of the email and it is not sent, an entry is placed into the G4MSMLGPF file as a log entry.

Returns: 0 for success, -1 for error.

Optional Parameters:

  • Recpient Name - Specify the recipient name as you would like it to appear on the emal

  • Recipient Type - Specify the type of recipient (TO=0, CC=1, BCC=2)

  • Error Message (output) - Error message

Settable Values:

  • id (required) - Specify the ID of the Microsoft Office 365 account

  • from (optional) - Specify the from email address. This is only required if the from address is different than the email address associated with the account and that address is allowed to send emails from this account id.

  • from_name (optional) - Specify the from address name

  • sender (optional) - Specify a sender address if required

  • sender_name (optional) - Specify a name for the sender

  • subject (optional) - Specify the subject of the email

  • message (optional) - Specify the message to send. The message can be in either text or html format. The special value of *STMF will allow you to use the contents of a stream file as the body of the message.

  • message_stream_file (optional) - Specify the fully qualified path to a stream file containing the message. This is only valid if the value of *STMF is used for the message parameter.

  • message_content_type (optional) - Specify the content-type of the message. This should be either text or html. Default is text.

  • message_importance (optional) - Specify the message importance (IMP_LOW = Low, IMP_NORMAL = Normal, IMP_HIGH = High). Default is Normal.

  • deliver_receipt_requested (optional) - Specify TRUE = true or FALSE = false to request a delivery receipt. Default is FALSE.

  • read_receipt_requested (optional) - Specify TRUE = true or FALSE = false to request a read receipt. Default is FALSE.

  • save_to_sent_items (optional) - Specify TRUE = true or FALSE = false to save the email to the Sent Folder. Default is TRUE.

  • dump_file - The fully qualified name of the dump file to create if there is an error sending the email. The default is <temp directory>/g4ms_<id>_dump.json.

  • ccnfiguration_file - The configuration file to use when the #g4msmail_loadDefaults() function is called. This should be a fully qualified file name or the value of *DFT. *DFT will attempt to use a configuration file named /bvstools/g4ms/config/<userid>/defaults.json where <userid> is the user ID of the person running the command.