无详细内容 Joomla $app = JFactory::getApplication();$acl = JFactory::getACL();$db = JFactory::getDbo();$groupId = 10;$uIds = $acl-getUsersByGroup($groupId, false);$query = $db-getQuery(true);$query-select('email');$query-from('#__users');$q
Joomla
$app = JFactory::getApplication(); $acl = JFactory::getACL(); $db = JFactory::getDbo(); $groupId = 10; $uIds = $acl->getUsersByGroup($groupId, false); $query = $db->getQuery(true); $query->select('email'); $query->from('#__users'); $query->where('id IN (' . implode(',', $uIds) . ')'); $query->where("block = 0 AND sendEmail = 1"); $db->setQuery($query); $rows = $db->loadColumn(); $mailer = JFactory::getMailer(); $mailer->setSender(array($app->getCfg('mailfrom'), $app->getCfg('fromname'))); $mailer->setSubject($subject); $mailer->setBody($body); $mailer->IsHTML(true); $mailer->addRecipient($rows); if (!$mailer->Send()) { JError::raiseWarning(500, JText::_('ERROR_SENDING_EMAIL')); }