4D Internet Commands v16

SMTP_Bcc

Home

 
4D Internet Commands v16
SMTP_Bcc

SMTP_Bcc 


 

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

The SMTP_Bcc command adds blind carbon copy recipients to the message specified by smtp_ID. It is not mandatory to have any addresses in the Bcc: field.

The only way to keep AddressList information confidential when sending mail to groups of people is to list the addresses within the "Bcc" header. The addresses listing in a "Bcc" header are not sent as part of the message header or body. The addresses will not be viewable by any recipient specified in the "To", "Cc" or "Bcc" headers.

The "Bcc" recipients will be able to see all "To" and "Cc" recipients, but they will not be able to see other "Bcc" recipients. Often group mailings to a large number of recipients will be addressed with all recipients placed in the "Bcc" header. This prevents the users from having large address lists cluttering the message and keeps them from accessing the addresses of others.

Another reason for the use of "Bcc" is that many mail applications have a "Reply All" feature which will add all recipients in the "To" and "Cc" sections to the replying message. Placing all recipient addresses within the "Bcc" header will prevent users from replying to every person who received the original message.

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

blindCarbon is a text value containing an AddressList of one or more mail addresses.

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

  • A value of zero will add the new value to the "Bcc" field.
  • A value of 1 will set the "Bcc" field to the new value, overriding any prior settings (if you pass an empty string in blindCarbon, the header will be removed from the mail envelope).
  • A value of 2 will delete any address previously defined for the "Bcc" 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 a message is created and the static elements are defined outside the scope of the 'for' loop. Then, for each record in the [People] table, an address is added to the blind carbon copy list.

 $error:=SMTP_From($smtp_id;"sales@massmarket.com")
 $error:=SMTP_Subject($smtp_id;"Terrific Sale! This week only!")
 $error:=SMTP_Body($smtp_id;$GenericBody)
 For($i;1;Records in selection([People]))
    $error:=SMTP_Bcc($smtp_id;[People]Email;0) `Add this email address to the BCC list
    NEXT RECORD([People])
 End for
 $error:=SMTP_Send($smtp_id`Send the message to everyone
 $error:=SMTP_Clear($smtp_id)



See also 

SMTP_Cc
SMTP_New

 
PROPERTIES 

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

 
HISTORY 

Created: 4D Internet Commands 6.5

 
ARTICLE USAGE

4D Internet Commands ( 4D Internet Commands v16)