original_string: public static function doSendEncode($alist, array $opts = array())
      {
          $out = array();
  
          foreach ($alist as $ob) {
              if (!empty($opts['defserver'])) {
                  foreach ($ob->raw_addresses as $ob2) {
                      if (is_null($ob2->host)) {
                          $ob2->host = $opts['defserver'];
                      }
                  }
              }
  
              $out[] = $ob->writeAddress(array(
                  'encode' => empty($opts['charset']) ? null : $opts['charset'],
                  'idn' => true
              ));
          }
  
          return $out;
      }
code: public static function doSendEncode($alist, array $opts = array())
      {
          $out = array();
  
          foreach ($alist as $ob) {
              if (!empty($opts['defserver'])) {
                  foreach ($ob->raw_addresses as $ob2) {
                      if (is_null($ob2->host)) {
                          $ob2->host = $opts['defserver'];
                      }
                  }
              }
  
              $out[] = $ob->writeAddress(array(
                  'encode' => empty($opts['charset']) ? null : $opts['charset'],
                  'idn' => true
              ));
          }
  
          return $out;
      }
code_tokens: public static function doSendEncode ( $ alist , array $ opts = array ( ) ) { $ out = array ( ) ; foreach ( $ alist as $ ob ) { if ( ! empty ( $ opts [ 'defserver' ] ) ) { foreach ( $ ob -> raw_addresses as $ ob2 ) { if ( is_null ( $ ob2 -> host ) ) { $ ob2 -> host = $ opts [ 'defserver' ] ; } } } $ out [ ] = $ ob -> writeAddress ( array ( 'encode' => empty ( $ opts [ 'charset' ] ) ? null : $ opts [ 'charset' ] , 'idn' => true ) ) ; } return $ out ; }
docstring: Do send encoding for addresses.
  
  Needed as a static function because it is used by both single and
  multiple address headers.
  
  @todo  Implement with traits.
  
  @param array $alist  An array of Horde_Mail_Rfc822_List objects.
  @param array $opts   Additional options:
  - charset: (string) Encodes the headers using this charset.
  DEFAULT: UTF-8
  - defserver: (string) The default domain to append to mailboxes.
  DEFAULT: No default name.
docstring_tokens: Do send encoding for addresses .