ISMessageRecipients.AddExternalProvider

Description

This function adds the selected external provider as a message recipient.

Syntax

object.AddExternalProvider aExternalProvider

Part Attribute Type Description
object Required
The object always implements the ISMessageRecipients interface
aExternalProvider In, Required
The external provider to be added as a message recipient

Example

Add the selected external provider as a message recipient and display the text of the message, its subject and recipients.

sub main()
  Dim aMes
  Dim aPatient
  Dim aProvider
  Dim aExProvider

  Set aMes = Profile.CreateMessage
  aMes.Text = aMes.AddText("Hello! Come to my birthday party!")
  aMes.Subject = "Birthday party"   
 
  set aPatient = Profile.SelectPatient
  if aPatient.Email <> "" then 
    aMes.Recipients.AddPatient(aPatient)
  end if
  
  set aProvider = Profile.LoadProvider("MM")
  if aProvider.Email <> "" then 
    aMes.Recipients.AddProvider(aProvider)
  end if
  
  set aExProvider = Profile.LoadExternalProvider("MILLEJ")
  if aExProvider.Email <> "" then
    aMes.Recipients.AddExternalProvider(aExProvider)
  end if
  
  aMes.Send
  
  Profile.MsgBox("The message was successfully sent." & vbNewLine &_
    GetMessageInfo(aMes))
end sub

function GetMessageInfo(aMessage)
  Dim aInfo
  Dim aMessageRecipients
  Dim aRecipient
  Dim i

  aInfo = "Subject: " & aMessage.Subject & vbNewLine &_ 
    "Text: " & aMessage.Text & vbNewLine
     
  set aMessageRecipients = aMessage.Recipients
  for i = 0 to aMessageRecipients.Count - 1
    set aRecipient = aMessageRecipients.Item(i) 
    aInfo = aInfo & "Recipients #" & (i + 1) & ": " &_
      aRecipient.DisplayText & vbNewLine 
  next

  GetMessageInfo = aInfo
end function
Note:

In Profile Client v8 on User Interface External Provider can be added as a message recipient in Organisation > Work Centre > Communication > Email > New message > Send to.

See also

Version information

Added in v8.4.18