X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=d76351b97ac6a9db60470c9b7d999836ece1f799;hb=69a7afc577b85a57bc04f676d273866191ab8462;hp=55623e1e812a6e07d9684817fbecf55b1dda02b1;hpb=3d487c263ea5c294418cd6cf2d5fc5bb9ffaacae;p=friendica.git diff --git a/src/App.php b/src/App.php index 55623e1e81..d76351b97a 100644 --- a/src/App.php +++ b/src/App.php @@ -1047,4 +1047,24 @@ class App unset($this->config[$uid][$cat][$k]); } } + + /** + * Generates the site's default sender email address + * + * @return string + */ + public function getSenderEmailAddress() + { + $sender_email = Config::get('config', 'sender_email'); + if (empty($sender_email)) { + $hostname = $this->get_hostname(); + if (strpos($hostname, ':')) { + $hostname = substr($hostname, 0, strpos($hostname, ':')); + } + + $sender_email = 'noreply@' . $hostname; + } + + return $sender_email; + } }