示例#1
0
 /**
  * @return string
  */
 function GetEncodedValue()
 {
     if ($this->IsParsed) {
         if ($this->IsEmailAddress()) {
             $addressCollection = new EmailAddressCollection($this->Value);
             return $addressCollection->ToString();
         }
         if ($this->IsSubject()) {
             return ConvertUtils::EncodeHeaderString($this->Value, $GLOBALS[MailInputCharset], $GLOBALS[MailOutputCharset], true);
         }
         if ($this->IsWithParameters()) {
             $parameterCollection = new HeaderParameterCollection($this->Value);
             return $parameterCollection->ToString(true);
         }
     }
     if (ConvertUtils::IsLatin($this->Value)) {
         return $this->Value;
     } else {
         return ConvertUtils::EncodeHeaderString($this->Value, $GLOBALS[MailInputCharset], $GLOBALS[MailOutputCharset]);
     }
 }