title: how to decode the subject in an email?
body: <p>I have send a mail with Subject line as</p>
  
  <p></p>
  
  <pre><code>[BILLING #PHY-945-49853]: [Ticket #12622] Payment Method
  </code></pre>
  
  <p>But in the source of the message the line is like below</p>
  
  <p></p>
  
  <pre><code>Subject: =?UTF-8?B?W1NBTEVTICNCQk4tOTM1LTM3OTE3XTogW1RpY2tldCAjMTI2MjJdIFBheW1lbnQ=?=
  =?UTF-8?B?IE1ldGhvZA==?=
  </code></pre>
  
  <p>It is encoded in Base64. How can I decode it back to the original subject line in English using php? I have tried with the php <code>base64_decode($subject)</code> but it does not decode it to the original subject ([BILLING #PHY-945-49853]: [Ticket #12622] Payment Method)</p>
  
  <p>I'm also attaching a sample email message:</p>
  
  <pre><code>Return-Path: .........
  X-Original-To: ..........
  Delivered-To: ........
  Received: ......
  X-DKIM: ........
  Received:....
  To: ....
  Subject: =?UTF-8?B?W1NBTEVTICNCQk4tOTM1LTM3OTE3XTogW1RpY2tldCAjMTI2MjJdIFBheW1lbnQ=?=
  =?UTF-8?B?IE1ldGhvZA==?=
  From: =?UTF-8?B?U0FWVllFSE9TVElORyBTQUxFUw==?=
  X-Priority: ..
  X-MSMail-Priority: normal
  X-MimeOLE: Produced By Kayako Fusion v4.01.204
  X-Mailer: Kayako Fusion v4.01.204
  Reply-To: .......
  Date: .....
  Content-Type: multipart/alternative;
  boundary="=_1.64496c432f57488924404b338155a2d7"
  MIME-Version: 1.0
  Message-Id: ....
  </code></pre>
  
  <p>This is a message in MIME Format. If you see this, your mail reader does not support this format.</p>
  
  <pre><code>--=_1.64496c432f57488924404b338155a2d7
  Content-Type: text/plain;
  charset="UTF-8"
  Content-Transfer-Encoding: quoted-printable
  Content-Disposition: inline
  
  
  ------------------------------------------------------
  Support Center:
  Content-Type: text/html;
  charset="UTF-8"
  Content-Transfer-Encoding: quoted-printable
  Content-Disposition: inline
  </code></pre>