[ Index ]

MailPress 7.2

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

title

Body

[close]

/mp-includes/class/ -> MP_Swift_Connection_smtp_SMTPUTF8.class.php (source)

   1  <?php
   2  class MP_Swift_Connection_smtp_SMTPUTF8 extends MP_Swift_connection_
   3  {
   4      public $Swift_Connection_type = 'SMTP';
   5  
   6      public static $DIR___ = __DIR__;
   7  
   8  	function connect( $mail_id, $y )
   9      {
  10          $settings = get_option( MailPress::option_name_smtp );
  11  
  12          $conn = new Swift_SmtpTransportSMTPUTF8();
  13  
  14          $conn->setHost( $settings['server'] );
  15          $conn->setPort( $settings['port'] );
  16  
  17          if ( !empty( $settings['ssl'] ) )
  18              $conn->setEncryption( $settings['ssl'] );
  19  
  20          if ( empty( $settings['username'] ) && empty( $settings['password'] ) )
  21          {
  22              $y->log( "**** Empty user/password for SMTP connection ****" );
  23          }
  24          else
  25          {
  26              if ( !empty( $settings['username'] ) )
  27              {
  28                  $conn->setUsername( $settings ['username'] );
  29                  if ( !empty( $settings['password'] ) )
  30                      $conn->setPassword( $settings ['password'] );
  31              }
  32          }
  33  
  34          // eventually popb4smtp ( other authentications are detected automatically )
  35          if ( isset( $settings['smtp-auth'] ) && ( !empty( $settings['smtp-auth'] ) ) )
  36          {
  37              switch ( $settings['smtp-auth'] )
  38              {
  39                  case '@PopB4Smtp' :
  40                      add_filter( 'MailPress_swift_registerPlugin', array( __CLASS__, 'registerPlugin' ), 8, 1 );
  41                  break;
  42              }
  43          }
  44  
  45          return $conn;
  46      }
  47  
  48  	public static function registerPlugin( $_this_swift )
  49      {
  50          $settings = get_option( MailPress::option_name_smtp );
  51  
  52          $_this_swift->registerPlugin( new Swift_Plugins_PopBeforeSmtpPlugin( $settings['pophost'], $settings['popport'] ) );
  53  
  54          return $_this_swift;
  55      }
  56  }


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