42 lines
1.6 KiB
PHP
42 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Config;
|
|
|
|
use CodeIgniter\Config\BaseConfig;
|
|
|
|
class Email extends BaseConfig
|
|
{
|
|
public string $protocol;
|
|
public string $SMTPHost;
|
|
public string $SMTPUser;
|
|
public string $SMTPPass;
|
|
public int $SMTPPort;
|
|
public string $SMTPCrypto;
|
|
|
|
public bool $SMTPAuth;
|
|
public int $SMTPTimeout;
|
|
public bool $SMTPKeepAlive;
|
|
|
|
public string $charset = 'UTF-8';
|
|
public string $mailType = 'html';
|
|
public bool $wordWrap = true;
|
|
|
|
public string $newline = "\r\n";
|
|
public string $CRLF = "\r\n";
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
$this->protocol = (string) env('mail.protocol', env('email.protocol', 'smtp'));
|
|
$this->SMTPHost = (string) env('mail.SMTPHost', env('email.SMTPHost', env('SMTP_HOST', 'smtp.gmail.com')));
|
|
$this->SMTPUser = (string) env('mail.SMTPUser', env('email.SMTPUser', env('SMTP_USER', '')));
|
|
$this->SMTPPass = (string) env('mail.SMTPPass', env('email.SMTPPass', env('SMTP_PASS', '')));
|
|
$this->SMTPPort = (int) env('mail.SMTPPort', env('email.SMTPPort', env('SMTP_PORT', 465)));
|
|
$this->SMTPCrypto = (string) env('mail.SMTPCrypto', env('email.SMTPCrypto', env('SMTP_ENCRYPTION', 'ssl')));
|
|
$this->SMTPAuth = filter_var(env('mail.SMTPAuth', env('email.SMTPAuth', true)), FILTER_VALIDATE_BOOLEAN);
|
|
$this->SMTPTimeout = (int) env('mail.SMTPTimeout', env('email.SMTPTimeout', 5));
|
|
$this->SMTPKeepAlive = filter_var(env('mail.SMTPKeepAlive', env('email.SMTPKeepAlive', true)), FILTER_VALIDATE_BOOLEAN);
|
|
}
|
|
}
|