9 155 MAIL_ADD_ATTACHMENT

LANSA Technical

9.155 MAIL_ADD_ATTACHMENT

Þ Note: Built-In Function Rules.

This Email handling Built-In Function is used to add a file to be sent as an attachment to the current email.

Successive calls enable an internal list of attachments for sending to be built-up.

For use with

LANSA for i

YES

 

Visual LANSA for Windows

YES

Refer to 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

Full path to file including directories (Windows) and file.

1

255

 

 

2

A

Opt

The attachment filename seen by the recipient, which may differ from the filename in the Full Path argument if temporary files are being used. Default behavior is mail system specific.

1

255

 

 

3

A

Opt

Reserved for future use. This argument is currently unused.

0

10

 

 

4

N

Opt

Reserved for future use. This argument is currently unused.

5

5

 

 

 

 

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

  • No attachments are defined immediately following a MAIL_START 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 will be lost. To restart processing, a new call to MAIL_START would be required.

Example

The following 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(Define attachment file)
USE BUILTIN(MAIL_ADD_ATTACHMENT) WITH_ARGS('c:\config.sys' 'MyConfig.txt') TO_GET(#LEM_RETC)