示例#1
0
文件: Login.php 项目: fuelphp/email
 /**
  * {@inheritdocs}
  */
 public function authenticate(Smtp $smtp)
 {
     $smtp->invoke(new Auth($smtp, "LOGIN"));
     $smtp->invoke(new Input($smtp, base64_encode($this->username)));
     if ($smtp->read()->getCode() === Authentication::ACCEPTED) {
         $smtp->invoke(new Input($smtp, base64_encode($this->password)));
         return $smtp->read()->getCode() === Authentication::AUTHENTICATION_PERFORMED;
     }
     return false;
 }
示例#2
0
文件: Plain.php 项目: fuelphp/email
 /**
  * {@inheritdocs}
  */
 public function authenticate(Smtp $smtp)
 {
     $smtp->invoke(new Auth($smtp, "PLAIN"));
     $smtp->invoke(new Input($smtp, base64_encode(sprintf("%s%s", $this->username, $this->password))));
     return $smtp->read()->getCode() === Authentication::AUTHENTICATION_PERFORMED;
 }