9 156 MAIL_ADD_ORIGINATOR

LANSA Technical

9.156 MAIL_ADD_ORIGINATOR

Þ Note: Built-In Function Rules.

This Email Handling Built-In Function is used to add the name of the original sender for the current email.

This call will allow you to specify the original sender for the message.

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

Display name of the message sender.

1

255

 

 

2

A

Opt

Sender's address. This address is provider-specific message delivery data. For outbound messages, this argument may be an address entered by the user for a sender that is not in an address book (that is, a custom sender). Default behavior is mail system specific.

1

255

 

 

 

 

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

  • On Windows systems, the mail system will normally use the current mail user as the original sender and will ignore this setting but no error will occur.
  • On IBM i, a mail message requires a minimum of one originator  (normally you would only provide one originator). If no originator is provided, the current user's email address is used. The current user must be registered in the SNADS directory and have a SMTP alias.
  • Under IBM i, enter the full email address (the address type prefix SMTP: is optional) in either the display name argument or the sender's address argument if a display name is specified.
  • 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

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.

Note: If you wish to use this example for testing you will need to insert a valid recipient's address in the required argument.

********** COMMENT(Define Message Originator if IBM i)
********** COMMENT(MAPI on non-IBM i usually defaults)
IF COND(*HOST)
USE BUILTIN(MAIL_ADD_ORIGINATOR) WITH_ARGS('SMTP:<-- recipient@address -->') TO_GET(#LEM_RETC)
ENDIF