diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-08-03 14:37:33 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-08-03 14:37:33 +0000 |
commit | 9983c9755ee33e56a7f16ab3896eea3406e56619 (patch) | |
tree | c4c4e610d1d77ece492e120257e64264f5a11713 /Postman/PostmanOptions.php | |
parent | f35c4d853e85952a21a019914cb46e8acf50e826 (diff) | |
download | Post-SMTP-9983c9755ee33e56a7f16ab3896eea3406e56619.zip |
Stupid idea ever - read the blog (postmansmtp.com)
Diffstat (limited to 'Postman/PostmanOptions.php')
-rw-r--r-- | Postman/PostmanOptions.php | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php index f0d675e..240b1aa 100644 --- a/Postman/PostmanOptions.php +++ b/Postman/PostmanOptions.php @@ -178,6 +178,10 @@ if ( ! class_exists( 'PostmanOptions' ) ) { } else { return self::DEFAULT_MAIL_LOG_ENABLED; } } public function getRunMode() { + if ( defined( 'POST_SMTP_RUN_MODE' ) ) { + return POST_SMTP_RUN_MODE; + } + if ( isset( $this->options [ self::RUN_MODE ] ) ) { return $this->options [ self::RUN_MODE ]; } else { return self::DEFAULT_RUN_MODE; } @@ -260,21 +264,11 @@ if ( ! class_exists( 'PostmanOptions' ) ) { return $this->options [ PostmanOptions::AUTHENTICATION_TYPE ]; } } public function getEncryptionType() { - $port = $this->getPort(); - switch ($port): - case 465: - return 'ssl'; - break; - case 587: - return 'tls'; - break; - case 2525: - return 'tls'; - break; - default: - return isset( $this->options [ PostmanOptions::SECURITY_TYPE ] ) ? $this->options [ PostmanOptions::SECURITY_TYPE ] : 'none'; - endswitch; + if ( isset( $this->options [ PostmanOptions::SECURITY_TYPE ] ) ) { + return $this->options [ PostmanOptions::SECURITY_TYPE ]; + } } + public function getUsername() { if ( defined( 'POST_SMTP_AUTH_USERNAME' ) ) { return POST_SMTP_AUTH_USERNAME; @@ -285,24 +279,35 @@ if ( ! class_exists( 'PostmanOptions' ) ) { } } public function getPassword() { - - if ( defined( 'POST_SMTP_AUTH_PASSWORD' ) ) { - return POST_SMTP_AUTH_PASSWORD; - } + if ( defined( 'POST_SMTP_AUTH_PASSWORD' ) ) { + return POST_SMTP_AUTH_PASSWORD; + } if ( isset( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] ) ) { return base64_decode( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] ); } } public function getMandrillApiKey() { + if ( defined( 'POST_SMTP_API_KEY' ) ) { + return POST_SMTP_API_KEY; + } + if ( isset( $this->options [ PostmanOptions::MANDRILL_API_KEY ] ) ) { return base64_decode( $this->options [ PostmanOptions::MANDRILL_API_KEY ] ); } } public function getSendGridApiKey() { + if ( defined( 'POST_SMTP_API_KEY' ) ) { + return POST_SMTP_API_KEY; + } + if ( isset( $this->options [ PostmanOptions::SENDGRID_API_KEY ] ) ) { return base64_decode( $this->options [ PostmanOptions::SENDGRID_API_KEY ] ); } } public function getMailgunApiKey() { + if ( defined( 'POST_SMTP_API_KEY' ) ) { + return POST_SMTP_API_KEY; + } + if ( isset( $this->options [ PostmanOptions::MAILGUN_API_KEY ] ) ) { return base64_decode( $this->options [ PostmanOptions::MAILGUN_API_KEY ] ); } } |