<?php
 class vB_Api_Mail extends vB_Api { public function send($to, $subject, $message) { $this->checkHasAdminPermission('canadminusers'); $this->logAdminAction(__FUNCTION__); if (!is_array($to)) { $to = explode(';', $to); } $sent = []; $failed = []; foreach ($to AS $toemail) { $result = vB_Mail::create2($toemail, $subject, $message)->send(true); if ($result) { $sent[] = $toemail; } else { $failed[] = $toemail; } } if (empty($failed)) { return ['success' => true]; } return [ 'success' => false, 'sent' => $sent, 'failed' => $failed, ]; } } 