[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/composer/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/ -> EightBitMimeHandler.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of SwiftMailer.
   5   * (c) 2018 Christian Schmidt
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  /**
  12   * An ESMTP handler for 8BITMIME support (RFC 6152).
  13   *
  14   * 8BITMIME is required when sending 8-bit content to over SMTP, e.g. when using
  15   * Swift_Mime_ContentEncoder_PlainContentEncoder in "8bit" mode.
  16   *
  17   * 8BITMIME mode is enabled unconditionally, even when sending ASCII-only
  18   * messages, so it should only be used with an outbound SMTP server that will
  19   * convert the message to 7-bit MIME if the next hop does not support 8BITMIME.
  20   *
  21   * @author Christian Schmidt
  22   */
  23  class Swift_Transport_Esmtp_EightBitMimeHandler implements Swift_Transport_EsmtpHandler
  24  {
  25      protected $encoding;
  26  
  27      /**
  28       * @param string $encoding The parameter so send with the MAIL FROM command;
  29       *                         either "8BITMIME" or "7BIT"
  30       */
  31      public function __construct(string $encoding = '8BITMIME')
  32      {
  33          $this->encoding = $encoding;
  34      }
  35  
  36      /**
  37       * Get the name of the ESMTP extension this handles.
  38       *
  39       * @return string
  40       */
  41      public function getHandledKeyword()
  42      {
  43          return '8BITMIME';
  44      }
  45  
  46      /**
  47       * Not used.
  48       */
  49      public function setKeywordParams(array $parameters)
  50      {
  51      }
  52  
  53      /**
  54       * Not used.
  55       */
  56      public function afterEhlo(Swift_Transport_SmtpAgent $agent)
  57      {
  58      }
  59  
  60      /**
  61       * Get params which are appended to MAIL FROM:<>.
  62       *
  63       * @return string[]
  64       */
  65      public function getMailParams()
  66      {
  67          return ['BODY='.$this->encoding];
  68      }
  69  
  70      /**
  71       * Not used.
  72       */
  73      public function getRcptParams()
  74      {
  75          return [];
  76      }
  77  
  78      /**
  79       * Not used.
  80       */
  81      public function onCommand(Swift_Transport_SmtpAgent $agent, $command, $codes = [], &$failedRecipients = null, &$stop = false)
  82      {
  83      }
  84  
  85      /**
  86       * Returns +1, -1 or 0 according to the rules for usort().
  87       *
  88       * This method is called to ensure extensions can be execute in an appropriate order.
  89       *
  90       * @param string $esmtpKeyword to compare with
  91       *
  92       * @return int
  93       */
  94      public function getPriorityOver($esmtpKeyword)
  95      {
  96          return 0;
  97      }
  98  
  99      /**
 100       * Not used.
 101       */
 102      public function exposeMixinMethods()
 103      {
 104          return [];
 105      }
 106  
 107      /**
 108       * Not used.
 109       */
 110      public function resetState()
 111      {
 112      }
 113  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1