9 158 MAIL_ADD_TEXT

LANSA Technical

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

LANSA for i

YES

 

Visual LANSA for Windows

YES

Refer to the Email Built-In Function Notes before using this Built-In Function.

Visual LANSA for Linux

NO

 

 

 

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Text to be added to the email message

1

Unlimited

 

 

2

A

Opt

Add new line to the end of the text.

Values:
Y - Yes
N - No

Default Y

1

1

 

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Opt

Return Code

OK - Action completed
ER - Error occurred

2

2

 

 

 

 

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)