PHPMailer\PHPMailer
POP3::login
Log in to the POP3 server. Does not support APOP (RFC 2828, 4949).
Method of the class: POP3{}
No Hooks.
Returns
true|false.
Usage
$POP3 = new POP3(); $POP3->login( $username, $password );
- $username(string)
- .
Default:'' - $password(string)
- .
Default:''
POP3::login() POP3::login code WP 6.9.1
public function login($username = '', $password = '')
{
if (!$this->connected) {
$this->setError('Not connected to POP3 server');
return false;
}
if (empty($username)) {
$username = $this->username;
}
if (empty($password)) {
$password = $this->password;
}
//Send the Username
$this->sendString("USER $username" . static::LE);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
//Send the Password
$this->sendString("PASS $password" . static::LE);
$pop3_response = $this->getResponse();
if ($this->checkResponse($pop3_response)) {
return true;
}
}
return false;
}