Command SMTP_Sender

4D Internet Commands

SMTP_Sender

version 6.5


SMTP_Sender (smtp_ID; msgSender{; deleteOption}) Integer

ParameterTypeDescription
smtp_IDLongintMessage reference
msgSenderTextMailAddress (1 only)
deleteOptionInteger0 = Add, 1 = Replace, 2 = Delete

Function result Integer Error Code

Description

The SMTP_Sender command adds the e-mail address of the person that sends the message. It is intended to be used when the sender is not the actual author of the message, or to indicate who among a group of authors actually sent the message. This field is not necessary if the contents of the "Sender" field would be redundant with the "From" field.

In cases where a computer program is the creator and sender of a mail message, the Sender header should reference the mail account of the real person responsible for administering the actions of the program and not the account managed by the computer program.

smtp_ID is the long integer reference to the mail message created with the SMTP_New command.

msgSender contains a single MailAddress to be listed in the Sender field of the message. Only one mail address may be specified for this header.

deleteOption is an integer value which specifies whether to add or delete the Sender header:

• A value of zero will add the new value to the Sender field.

• A value of 1 will set the Sender field to the new value, overriding any prior settings (if you pass an empty string in msgSender, the header will be removed from the mail envelope).

• A value of 2 will delete any address previously defined for the Sender field and remove the header from the mail envelope.

deleteOption is an optional parameter which will default to zero if not otherwise specified.

Example

In this example, three executives compose a message on the subject of a company policy change which is then distributed by the secretary to everyone in the company. Any responses to this message would be directed back to each of the three people listed in the "From" header.

   $From:="[email protected], [email protected], [email protected]"
   $Error:=SMTP_From ($smtp_id;$From;0)
   $Error:=SMTP_Sender ($smtp_id;"[email protected]";0)
   $Error:=SMTP_Subject ($smtp_id;"Company Policy Change";0)
   $Error:=SMTP_To ($smtp_id;<>AllEmployee;0)

See Also

SMTP_New.