public bool
useSmtp
(mixed $auth = null, mixed $host = null, mixed $user = null, mixed $pass = null, mixed $secure = null, mixed $port = 25)
/**
* Use SMTP for sending the email
*
* @param string $auth SMTP Authentication [optional]
* @param string $host SMTP Host [optional]
* @param string $user SMTP Username [optional]
* @param string $pass SMTP Password [optional]
* @param string $secure Use secure methods
* @param integer $port The SMTP port
*
* @return boolean True on success
*
* @since 1.7.0
*/
public function useSmtp($auth = null, $host = null, $user = null, $pass = null, $secure = null, $port = 25)
{
$this->SMTPAuth = $auth;
$this->Host = $host;
$this->Username = $user;
$this->Password = $pass;
$this->Port = $port;
if ($secure === 'ssl' || $secure === 'tls') {
$this->SMTPSecure = $secure;
}
if ($this->SMTPAuth !== null && $this->Host !== null && $this->Username !== null && $this->Password !== null || $this->SMTPAuth === null && $this->Host !== null) {
$this->isSMTP();
return true;
} else {
$this->isMail();
return false;
}
}