- $hostname = DI::baseUrl()->getHostname();
- if (strpos($hostname, ':')) {
- $hostname = substr($hostname, 0, strpos($hostname, ':'));
- }
-
- $sender_email = DI::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.';
-
- // enable addon for test
- DI::pConfig()->set(local_user(), 'securemail', 'enable', 1);
-
- $res = DI::emailer()->send($sitename, $sender_email, $sender_email,
- $a->user['email'], $subject, "<p>{$message}</p>", $message,
- '', local_user());
+ $res = DI::emailer()->send(new SecureTestEmail(DI::app(), DI::config(), DI::pConfig(), DI::baseUrl()));