AddMailRecipient()

Syntax

AddMailRecipient(#Mail, Address$, Flags)
Description
Add a recipient to the specified mail.

Parameters

#Mail The mail to use.
Address$ The address of the recipient. The address have to be one of the following format:
  "joe.doe@domain.com"
  "<joe.doe@domain.com>"
  "Joe Doe <joe.doe@domain.com>"
Flags The categories to which to add the recipient. It can be a combination of the following values:
  #PB_Mail_To : Main(s) recipient(s) of the mail
  #PB_Mail_Cc : Recipient(s) which are in copy of the mail (and everybody see it)
  #PB_Mail_Bcc: Recipient(s) which are in copy of the mail (but nobody see it)

Return value

None.

Example

  InitNetwork()

  If CreateMail(0, "test@purebasic.com", "Hello")
    AddMailRecipient(0, "andre@purebasic.com", #PB_Mail_To) ; Andre is the main recipient
    AddMailRecipient(0, "fred@purebasic.com", #PB_Mail_Cc)  ; Fred is in copy
    AddMailRecipient(0, "timo@purebasic.com", #PB_Mail_Bcc) ; Timo is in copy as well, but Andre and Fred doesn't know it
  EndIf

See Also

RemoveMailRecipient(), CreateMail()

Supported OS

All

<- AddMailAttachmentData() - Mail Index - CreateMail() ->