From a69a2f8b2d2125b556ff2fa21c26b58884bebd49 Mon Sep 17 00:00:00 2001 From: Marcel Link Date: Tue, 23 Jul 2024 13:55:13 +0200 Subject: [PATCH] Add basic e-mail settings to config.php --- application/config/email.php | 26 +++++++++++++------------- config-sample.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/application/config/email.php b/application/config/email.php index 0b24bad5..a47de6f1 100644 --- a/application/config/email.php +++ b/application/config/email.php @@ -4,18 +4,18 @@ // Example: $config['smtp_host'] = 'smtp.gmail.com'; // @link https://codeigniter.com/user_guide/libraries/email.html -$config['useragent'] = 'Easy!Appointments'; -$config['protocol'] = 'mail'; // or 'smtp' -$config['mailtype'] = 'html'; // or 'text' -// $config['smtp_debug'] = '0'; // or '1' -// $config['smtp_auth'] = TRUE; //or FALSE for anonymous relay. -// $config['smtp_host'] = ''; -// $config['smtp_user'] = ''; -// $config['smtp_pass'] = ''; -// $config['smtp_crypto'] = 'ssl'; // or 'tls' -// $config['smtp_port'] = 25; -// $config['from_name'] = ''; -// $config['from_address'] = ''; -// $config['reply_to'] = ''; +$config['useragent'] = Config::EMAIL_USERAGENT; +$config['protocol'] = Config::EMAIL_PROTOCOL; +$config['mailtype'] = Config::EMAIL_MAILTYPE; +$config['smtp_debug'] = Config::EMAIL_SMTP_DEBUG; +$config['smtp_auth'] = Config::EMAIL_SMTP_AUTH; +$config['smtp_host'] = Config::EMAIL_SMTP_HOST; +$config['smtp_user'] = Config::EMAIL_SMTP_USER; +$config['smtp_pass'] = Config::EMAIL_SMTP_PASS; +$config['smtp_crypto'] = Config::EMAIL_SMTP_CRYPTO; +$config['smtp_port'] = Config::EMAIL_SMTP_PORT; +$config['from_name'] = Config::EMAIL_FROM_NAME; +$config['from_address'] = Config::EMAIL_FROM_ADDRESS; +$config['reply_to'] = Config::EMAIL_REPLY_TO; $config['crlf'] = "\r\n"; $config['newline'] = "\r\n"; diff --git a/config-sample.php b/config-sample.php index cffd82b6..32d6706b 100644 --- a/config-sample.php +++ b/config-sample.php @@ -50,4 +50,37 @@ class Config const GOOGLE_SYNC_FEATURE = false; // Enter TRUE or FALSE const GOOGLE_CLIENT_ID = ''; const GOOGLE_CLIENT_SECRET = ''; + + // ------------------------------------------------------------------------ + // E-MAIL SETTINGS + // ------------------------------------------------------------------------ + + // Add custom values by settings them to the $config array in application/config/email.php. + // @link https://codeigniter.com/user_guide/libraries/email.html + + const EMAIL_USERAGENT = 'Easy!Appointments'; + const EMAIL_PROTOCOL = 'mail'; // or 'smtp' + const EMAIL_MAILTYPE = 'html'; // or 'text' + const EMAIL_SMTP_DEBUG = '0'; // or '1' + const EMAIL_SMTP_AUTH = TRUE; //or FALSE for anonymous relay. + const EMAIL_SMTP_HOST = ''; + const EMAIL_SMTP_USER = ''; + const EMAIL_SMTP_PASS = ''; + const EMAIL_SMTP_CRYPTO = 'ssl'; + const EMAIL_SMTP_PORT = 25; + const EMAIL_FROM_NAME = ''; + const EMAIL_FROM_ADDRESS = ''; + const EMAIL_REPLY_TO = ''; + + + /* Example Exchange OnPremise 2019 + const EMAIL_PROTOCOL = 'smtp'; // or 'smtp' + const EMAIL_SMTP_AUTH = TRUE; //or FALSE for anonymous relay. + const EMAIL_SMTP_HOST = ''; // hostname + const EMAIL_SMTP_USER = ''; // e-mail + const EMAIL_SMTP_PASS = ''; // password + const EMAIL_SMTP_CRYPTO = 'tls'; // STARTTLS necessary + const EMAIL_SMTP_PORT = 587; + const EMAIL_FROM_ADDRESS = ''; // e-mail + */ }