Changeset 930 for trunk/Packages/Common


Ignore:
Timestamp:
May 11, 2022, 12:21:42 PM (3 years ago)
Author:
chronos
Message:
  • Fixed: Encode utf-8 names in "from" email field.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Mail.php

    r916 r930  
    135135    if ($this->AgentIdent != '') $this->Headers['X-Mailer'] = $this->AgentIdent;
    136136    if ($this->ReplyTo != '') $this->Headers['Reply-To'] = $this->ReplyTo;
    137     if ($this->From != '') $this->Headers['From'] = $this->From;
     137    if ($this->From != '')
     138    {
     139      $IndexStart = strpos($this->From, '<');
     140      if ($IndexStart !== false)
     141      {
     142        $this->Headers['From'] = '=?utf-8?Q?'.quoted_printable_encode(trim(substr($this->From, 0, $IndexStart))).'?= '.substr($this->From, $IndexStart);
     143      } else
     144      {
     145        $this->Headers['From'] = $this->From;
     146      }
     147    }
    138148
    139149    $Headers = '';
Note: See TracChangeset for help on using the changeset viewer.