company logo

Email :: replaceReceiverName - Change receiver's display name

Usually, the receiver display name is set before the message is composed. In order to be able to re-send a message several times to different addresses, the To option in the message header should be updated. In order to avoid reconstructing the message before each delivery, this function may be called for updating the message header, only.

Return value:  Success ( bool  )

The value is true when the function was executed successfully. Otherwise the value is set to false.

Implementation details

bool Email  :: replaceReceiverName ( odaba::String &cName )

The function replaces the receiver name in the message header with the text passed in cName. When the message has not yet been constructed, the receiver name is stored to the receiverName property, only. Before calling the function, the receiver should be set properly.

// osi fragment. receivers is a collection of users

// message has already been constructed

  receivers.top;

  while ( receivers.next ) {

    if ( receivers.email == "" )

      Message("Empfänger " + receiver.first_name + ' ' + receiver.name + " hat keine EMail-Adresse");

    else {

      names = receiver.first_name+' '+receiver.name+' <'+receiver.email+'>';

      mail.replaceReceiverName(names);

      if ( !SendMail() )

        bState = false;

    }

  }

  • cName - - Title unknown