9.157 MAIL_ADD_RECIPIENT
Þ Note: Built-In Function Rules.
This Email handling Built-In Function is used to add the name of a recipient for the current email.
Successive calls enable an internal list of recipients to be built up. As a minimum you would normally define at least one recipient of class "TO".
For use with
|
Arguments
|
Return Values
|
Technical Notes
- No recipients are defined immediately following a MAIL_START call.
- The optional Recipient's address may be an address entered by the user for a recipient not in an address book (that is, a custom recipient). Default behavior is mail system specific. MAPI will typically require that you provide this address in the form:
<address type>:<full address>
For example:
Microsoft PC Mail: |
MS:network/postoffice/mailbox |
Internet: |
SMTP:[email protected] |
- Under IBM i, enter the full email address (the address type prefix SMTP: is optional) in the display name argument or the sender's address argument if a display name is specified. A mail message requires a minimum of one recipient.
- 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 destroyed. To restart processing, a new call to MAIL_START is required.
Example
This example shows only this function. Refer to the 9.162 MAIL_START example, which defines all details of an Email message.
Note: If you wish to use this example for testing you should insert a valid display name as the second argument and insert a valid recipient's address as the third argument.
********** COMMENT(Set Recipient using TO argument)
********** COMMENT(may also set others for TO CC BCC)
lansaELSE
USE BUILTIN(MAIL_ADD_RECIPIENT) WITH_ARGS(TO '<-- name -->' 'SMTP:<-- recipient@address -->')
TO_GET(#LEM_RETC)