4D Internet Commands v14

SMTP_From

Home

 
4D Internet Commands v14
SMTP_From

SMTP_From 


 

SMTP_From ( smtp_ID ; msgFrom {; deleteOption} ) -> Function result 
Parameter Type   Description
smtp_ID  Longint in Message reference
msgFrom  Text in MailAddress or AddressList
deleteOption  Integer in 0 = Add, 1 = Replace, 2 = Delete
Function result  Integer in Error Code

The SMTP_From command contains the mail address(es) of the person(s) to be listed in the "From" field of the message. The addresses in this field are those of the persons responsible for creating or authorizing the message. Normally, the "From" header contains one address representing the person who composed and sent the message. There may be circumstances however in which a message is composed by a group of people who should each be individually recognized within the "From" header.

The "From" header is mandatory. If an address is specified in the "From" header the existence of the "Sender" header is optional.

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

msgFrom is a text value containing an AddressList of one or more mail addresses. All addresses listed in the From header are visible to the recipients of the message.

Auto-Reply note: If a "ReplyTo" header is not defined for the message identified by smtp_ID then all replies to the message will be directed back to each person specified in the "From" header.

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

  • A value of zero will add the new value to the "From" field.
  • A value of 1 will set the "From" field to the new value, overriding any prior settings (if you pass an empty string in msgFrom, the header will be removed from the mail envelope).
  • A value of 2 will delete any address previously defined for the "From" 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 people compose a message on the subject of a company policy change that is distributed 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:="prez@acme.com, vp@acme.com, cfo@acme.com"
 $Error:=SMTP_From($smtp_id;$From;0)
 $Error:=SMTP_Subject($smtp_id;"Company Policy Change";0)
 $Error:=SMTP_To($smtp_id;◊AllEmployee;0)

 
PROPERTIES 

Product: 4D Internet Commands
Theme: IC Send Mail
Number: 88986

 
HISTORY 

Created: 4D Internet Commands 6.5

 
SEE ALSO 

SMTP_New

 
ARTICLE USAGE

4D Internet Commands ( 4D Internet Commands v11.4)
4D Internet Commands ( 4D v13.2)
4D Internet Commands ( 4D Internet Commands v12.1)
4D Internet Commands ( 4D Internet Commands v14 R2)
4D Internet Commands ( 4D Internet Commands v14)
4D Internet Commands ( 4D Internet Commands v14 R3)
4D Internet Commands ( 4D Internet Commands v14 R4)