ISMessage.DestinationEMail

Description

The email address of the recipient.

Syntax

object.DestinationEMail

Part Attribute Type Description
object Required
The object always implements the ISMessage interface
Restriction: This property is readonly.

Return Value

string

Example

Add a new message and display its text, the full name and the email address of the recipient.

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 Message
  Dim i

  aInfo = "Subject: " & aMessage.Subject & vbNewLine &_ 
    "Text: " & aMessage.Text & vbNewLine & "Email: " &_
    aMessage.DestinationEMail & vbNewLine
     
  if not aMessage.Patient is nothing then
    aInfo = aInfo &_                        
      "Patient: " & aMessage.Patient.SurnameFirstName & vbNewLine
  end if

  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 Destination EMail can be found in Organisation > Work Centre > Communication > Email > Outbox > Destination.

Version information

Added in v7.8.0