AddressStructure.class.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * AddressStructure.class.php
  4. *
  5. * Copyright (c) 2002 The SquirrelMail Project Team
  6. * Licensed under the GNU GPL. For full terms see the file COPYING.
  7. *
  8. * This contains functions needed to handle mime messages.
  9. *
  10. * $Id$
  11. */
  12. class AddressStructure {
  13. var $personal = '',
  14. $adl = '',
  15. $mailbox = '',
  16. $host = '',
  17. $group = '';
  18. function getAddress($full = true) {
  19. $result = '';
  20. if (is_object($this)) {
  21. if (isset($this->host) && ($this->host != '')) {
  22. $email = $this->mailbox.'@'.$this->host;
  23. } else {
  24. $email = $this->mailbox;
  25. }
  26. if (trim($this->personal) != '') {
  27. if ($email) {
  28. $addr = '"' . $this->personal . '" <' .$email.'>';
  29. } else {
  30. $addr = $this->personal;
  31. }
  32. $best_dpl = $this->personal;
  33. } else {
  34. $addr = $email;
  35. $best_dpl = $email;
  36. }
  37. $result = ($full ? $addr : $best_dpl);
  38. }
  39. return $result;
  40. }
  41. }
  42. ?>