- // If this is a public message and pubmail is set on the parent, include all your email contacts
- if (!empty($target_item) && function_exists('imap_open') && !Config::get('system','imap_disabled')) {
- if (!strlen($target_item['allow_cid']) && !strlen($target_item['allow_gid'])
- && !strlen($target_item['deny_cid']) && !strlen($target_item['deny_gid'])
- && intval($target_item['pubmail'])) {
- $mail_contacts_stmt = DBA::select('contact', ['id'], ['uid' => $uid, 'network' => Protocol::MAIL]);
- while ($mail_contact = DBA::fetch($mail_contacts_stmt)) {
- $recipients[] = $mail_contact['id'];
- }
- DBA::close($mail_contacts_stmt);
- }
- }
-