- $hostname = DI::baseUrl()->getHostname();
- if (strpos($hostname, ':')) {
- $hostname = substr($hostname, 0, strpos($hostname, ':'));
- }
-
- $sender_email = Config::get('config', 'sender_email');
- if (empty($sender_email)) {
- $sender_email = 'noreply@' . $hostname;
- }
-
- $subject = 'Friendica - Secure Mail - Test';
- $message = 'This is a test message from your Friendica Secure Mail addon.';
-
- $params = [
- 'uid' => local_user(),
- 'fromName' => $sitename,
- 'fromEmail' => $sender_email,
- 'toEmail' => $a->user['email'],
- 'messageSubject' => $subject,
- 'htmlVersion' => "<p>{$message}</p>",
- 'textVersion' => $message,
- ];
-
- // enable addon for test
- PConfig::set(local_user(), 'securemail', 'enable', 1);
-
- $res = Emailer::send($params);