9.158 MAIL_ADD_TEXT
Þ Note: Built-In Function Rules.
This Email handling Built-In Function is used to add text to the message buffer for the current email.
Successive calls enable a message text to be built up by concatenating the text to the end of the buffer. Each call may determine if a newline is to be added to the end of the text in that call.
For use with
|
Arguments
|
Return Values
|
Technical Notes
- The message buffer is cleared when MAIL_START is called.
- Trailing blanks in the text are truncated. If you require blanks to be inserted between successive calls that have no intervening new line, place the blanks at the beginning of the later call.
- Details of the email definition will be lost unless the MAIL_SEND Built-In Function is used to send the message.
- If any error occurs, all details of the email definition are destroyed. To restart processing, a new call to MAIL_START would be required.
For the maximum possible length of a field type please refer to Field Type Considerations.
Example
This example shows only this function. See the example for MAIL_START which defines all details of an Email message and then sends it by using Built-In Functions.
********** COMMENT(Set message Text)
USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS('Hello,' Y) TO_GET(#LEM_RETC)
DEFINE FIELD(#BIGLINE) TYPE(*CHAR) LENGTH(255) LABEL('Big Text Line') INPUT_ATR(LC)
CHANGE FIELD(#BIGLINE) TO('''I am sending this message just to try out the LANSA Email Built-In Functions.''')
USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS(#BIGLINE Y) TO_GET(#LEM_RETC)
USE BUILTIN(MAIL_ADD_TEXT) WITH_ARGS('Thank You' N) TO_GET(#LEM_RETC)