本文整理汇总了PHP中emailer::cc方法的典型用法代码示例。如果您正苦于以下问题:PHP emailer::cc方法的具体用法?PHP emailer::cc怎么用?PHP emailer::cc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类emailer
的用法示例。
在下文中一共展示了emailer::cc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function _form_home()
{
global $core, $user, $style;
$tree = $this->valid_tree();
if (!$tree['tree_form']) {
_fatal();
}
if ($tree['tree_parent']) {
$sql = 'SELECT *
FROM _tree
WHERE tree_id = ' . (int) $tree['tree_parent'];
$parent = $this->_fieldrow($sql);
if ($tree['tree_level'] > 2) {
$sql = 'SELECT *
FROM _tree
WHERE tree_id = ' . (int) $parent['tree_parent'];
$subparent = $this->_fieldrow($sql);
}
}
if ($tree['tree_node']) {
$sql = 'SELECT *
FROM _tree
WHERE tree_id = ' . (int) $tree['tree_node'];
$node = $this->_fieldrow($sql);
}
//
$sql = 'SELECT *
FROM _form_fields
WHERE form_tree = ' . (int) $tree['tree_id'] . '
ORDER BY form_order';
$form = $this->_rowset($sql, 'form_alias');
if (!count($form)) {
$sql = 'SELECT *
FROM _form_fields
WHERE form_tree = 0
ORDER BY form_order';
$form = $this->_rowset($sql, 'form_alias');
}
$form['ctkey'] = array('form_required' => 1, 'form_regex' => '^([a-zA-Z]+)$', 'form_alias' => 'ctkey', 'form_type' => 'text', 'form_legend' => 'Imagen de seguridad');
if (_button()) {
$va = array();
foreach ($form as $row) {
$va[] = $row['form_alias'];
}
$v = $this->__($va);
foreach ($form as $row) {
if (empty($v[$row['form_alias']])) {
if ($row['form_required']) {
$this->error(sprintf(_lang('E_COMMENT_FIELD_EMPTY'), $row['form_legend']), false);
}
continue;
}
if (!empty($row['form_regex']) && !preg_match('#' . $row['form_regex'] . '#is', $v[$row['form_alias']])) {
$this->error(sprintf(_lang('E_COMMENT_FIELD_BAD'), $row['form_legend']), false);
if ($row['form_alias'] == 'ctkey') {
$v[$row['form_alias']] = '';
}
}
}
if (!$this->errors()) {
include XFS . 'core/xcf.php';
$xcf = new captcha();
if ($xcf->check($v['ctkey']) === false) {
$v['ctkey'] = '';
$this->error('E_COMMENT_INVALID_CAPTCHA');
}
unset($xcf);
}
if (!$this->errors()) {
include XFS . 'core/emailer.php';
$emailer = new emailer();
$v['subject'] = preg_replace('#\\&([A-Za-z]+){1}(.*?)\\;#e', "substr('\\1', 0, 1)", $v['subject']);
$emailer->from($v['email']);
$emailer->set_subject($v['subject']);
$emailer->use_template('contact_email', $core->v('default_lang'));
foreach (explode(';', $tree['tree_form_email']) as $i => $address) {
$row_f = !$i ? 'email_address' : 'cc';
$emailer->{$row_f}($address);
}
$emailer->cc($core->v('default_email'));
unset($v['ctkey']);
$html = array();
foreach ($form as $row) {
if (empty($v[$row['form_alias']])) {
continue;
}
if ($row['form_alias'] == 'message') {
$v['message'] = str_replace("\r\n", '<br />', $v['message']);
}
$html[] = '<strong>' . $row['form_legend'] . ':</strong><br />' . $v[$row['form_alias']];
}
$emailer->assign_vars(array('HTML_FIELDS' => implode('<br /><br />', $html), 'FROM_USERNAME' => $v['nombre'], 'FORM_ARTICLE' => $tree['tree_subject']));
$emailer->send();
$emailer->reset();
//
$style->assign_block_vars('sent', array('THANKS' => _lang('CONTACT_THANKS')));
}
}
if (!_button() || $this->errors()) {
if ($this->errors()) {
//.........这里部分代码省略.........
示例2: date
AND user_birthday LIKE '%??'
AND user_birthday_last < ?
ORDER BY username
LIMIT ??";
$result = sql_rowset(sql_filter($sql, USER_INACTIVE, date('md'), date('Y'), $max_email));
$done = array();
$usernames = array();
foreach ($result as $row) {
$emailer->from('notify');
$emailer->use_template('user_birthday');
$emailer->email_address($row['user_email']);
if (!empty($row['user_public_email']) && $row['user_email'] != $row['user_public_email'])
{
$emailer->cc($row['user_public_email']);
}
$emailer->assign_vars(array(
'USERNAME' => $row['username'])
);
$emailer->send();
$emailer->reset();
$done[] = $row['user_id'];
$usernames[] = $row['username'];
}
if (count($done))
{
$sql = 'UPDATE _members SET user_birthday_last = ?