This documentation is designed for PicLan-IP build 2.0.0(129)
In order to use email functions, you will need to have the following elements in place:
If your ISP has an email server, you can send email to that server and it will forward it to the destination address.The advantage of using your ISP's email server is that it will take care of email retries without your system needing to worry about it. The advantage of sending the mail directly is that you do not rely on your ISP's mail server. To understand the importance of this decision, a quick discussion of internet mail routing is appropriate here:You can send the email directly to the destination address (or to one of the destinations backup relays).
When email is sent over the internet, there is no expectation that the mail can be sent instantaniously. In fact, the standard requires that a mail server try to deliver a message for five days before giving up on it. If you setup your Pick system to directly send mail to a destination mailbox and not use your ISP's mail server, then your Pick system has the responsibility of trying to send a message for five days. If the Pick host is a production system that is always running, this is probably fine. If the Pick host is a part-time host, then using your ISP's mail server is better because it becomes another system's responsibility to retry failed mail messages.
Email Subroutine Documentation
You have two choices in formatting a message. Your application program can build the message itself as a text string using attribute marks to delimit lines, or you can use a helper subroutine within PicLan-IP to add internet header fields onto you message body.
If you use the helper function, you application will call the subroutine:
This subroutine will take the contents of PARMS and CONTENTS and return MSG, FR.ADDR, TO.ADDR, and R.ERR. The PARMS and CONTENTS parameters are designed to support multi-part and encoded messages, even though these functions are not working in the build.DIM CONTENTS(100) ... PLM.BUILD.MSG(PARMS,MAT CONTENTS,MSG,FR.ADDR,TO.ADDR,R.ERR)
The FR.ADDR, TO.ADDR, and MSG fields are the results of the PLM.BUILD.MSG subroutine.PLM.SEND(FR.ADDR,TO.ADDR,MSG,ID,R.ERR)
The ID is a string returned that identifies the message so that you can subsequently check on it's status.
The R.ERR is a string returned that indicates any error condition that prevents the message from being scheduled. Even if the error string is null, the message will not necessarily be delivered if it has invalid addresses or if network connections or mail hosts are down.
This TCP command will take an input data file along with an active select list and generate one email message for each item in the specified data file. The format of these items is:PLM-SEND-BATCH file
001 FR.ADDR 002 TO.ADDR (multi-valued if multiple addresses are specified) 003 MSG
{INCLUDE _GEN_FTR.HTM}