当前位置: 首页>>代码示例>>PHP>>正文


PHP emailer::from方法代码示例

本文整理汇总了PHP中emailer::from方法的典型用法代码示例。如果您正苦于以下问题:PHP emailer::from方法的具体用法?PHP emailer::from怎么用?PHP emailer::from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在emailer的用法示例。


在下文中一共展示了emailer::from方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: home

    function home()
    {
        global $user;
        $sql = 'SELECT *
			FROM _email
			WHERE email_active = ??
			LIMIT ??';
        if (!($email = _fieldrow(sql_filter($sql, 1, 1)))) {
            $this->e('No queue emails.');
        }
        set_time_limit(0);
        if (!$email['email_start']) {
            $sql = 'UPDATE _email SET email_start = ?
				WHERE email_id = ?';
            _sql(sql_filter($sql, time(), $email['email_id']));
        }
        $sql = 'SELECT user_id, user_username, user_email
			FROM _members
			WHERE user_type = ?
				AND user_id <> ?
			ORDER BY user_username
			LIMIT ??, ??';
        $members = _rowset(sql_filter($sql, 1, 1, $email['email_last'], 100));
        $i = 0;
        foreach ($members as $row) {
            if (!preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $row['user_email'])) {
                continue;
            }
            if (!$i) {
                include XFS . 'core/emailer.php';
                $emailer = new emailer();
            }
            $emailer->use_template('mass');
            $emailer->format('plain');
            $emailer->from('TWC Kaulitz <twc_princess@twckaulitz.com>');
            $emailer->set_subject(entity_decode($email['email_subject']));
            $emailer->email_address($row['user_email']);
            $emailer->assign_vars(array('USERNAME' => $row['user_username'], 'MESSAGE' => entity_decode($email['email_message'])));
            $emailer->send();
            $emailer->reset();
            sleep(2);
            $i++;
        }
        if ($i) {
            $email['email_last'] += $i;
            $sql = 'UPDATE _email SET email_last = ?
				WHERE email_id = ?';
            _sql(sql_filter($sql, $email['email_last'], $email['email_id']));
        } else {
            $sql = 'UPDATE _email SET email_active = ?, email_end = ?
				WHERE email_id = ?';
            _sql(sql_filter($sql, 0, time(), $email['email_id']));
            $this->e('Finished processing [' . $email['email_id'] . '] emails.');
        }
        $this->e('Processed ' . $i . ' emails.');
        return;
    }
开发者ID:nopticon,项目名称:noptc,代码行数:57,代码来源:_email.php

示例2: _home

	public function _home() {
		global $config, $user, $cache;

		if (!_button()) {
			return false;
		}

		$username1 = request_var('username1', '');
		$username2 = request_var('username2', '');
		if (empty($username1) || empty($username2)) {
			fatal_error();
		}

		$username_base1 = get_username_base($username1);
		$username_base2 = get_username_base($username2);

		$sql = 'SELECT *
			FROM _members
			WHERE username_base = ?';
		if (!$userdata = sql_fieldrow(sql_filter($sql, $username_base1))) {
			_pre('El usuario no existe.', true);
		}

		$sql = 'SELECT *
			FROM _members
			WHERE username_base = ?';
		if ($void = sql_fieldrow(sql_filter($sql, $username_base2))) {
			_pre('El usuario ya existe.', true);
		}

		//
		$sql = 'UPDATE _members SET username = ?, username_base = ?
			WHERE user_id = ?';
		sql_query(sql_filter($sql, $username2, $username_base2, $userdata['user_id']));

		$emailer = new emailer();

		$emailer->from('info');
		$emailer->use_template('username_change', $config['default_lang']);
		$emailer->email_address($userdata['user_email']);

		$emailer->assign_vars(array(
			'USERNAME' => $userdata['username'],
			'NEW_USERNAME' => $username2,
			'U_USERNAME' => s_link('m', $username_base2))
		);
		$emailer->send();
		$emailer->reset();

		redirect(s_link('m', $username_base2));

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:53,代码来源:user_name_change.php

示例3: home

    function home()
    {
        $sql = 'SELECT *
			FROM _members
			WHERE user_type = ?
				AND user_birthday LIKE ?
				AND user_birthday_last < ?
			ORDER BY user_username
			LIMIT ??';
        $birthday = _rowset(sql_filter($sql, 1, '%' . date('md'), date('Y'), 10));
        if (!$birthday) {
            $this->e('None.');
        }
        $process = w();
        foreach ($birthday as $i => $row) {
            if (!$i) {
                @set_time_limit(0);
                require XFS . 'core/emailer.php';
                $emailer = new emailer();
            }
            $emailer->format('plain');
            $emailer->from('TWC Kaulitz <twc_princess@twckaulitz.com>');
            $emailer->use_template('user_birthday');
            $emailer->email_address($row['user_email']);
            $emailer->assign_vars(array('USERNAME' => $row['user_username']));
            $emailer->send();
            $emailer->reset();
            $process[$row['user_id']] = $row['user_username'];
        }
        if (count($process)) {
            $sql = 'UPDATE _members SET user_birthday_last = ?
				WHERE user_id IN (??)';
            _sql(sql_filter($sql, date('Y'), _implode(',', array_keys($process))));
        }
        return $this->e('Done @ ' . implode(',', array_values($process)));
    }
开发者ID:nopticon,项目名称:noptc,代码行数:36,代码来源:_birthday.php

示例4: user_notification

function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user)
{
	global $config, $lang, $userdata, $user_ip;

	$current_time = time();

	if ($mode == 'delete')
	{
		$delete_sql = (!$post_data['first_post'] && !$post_data['last_post']) ? sql_filter(' AND user_id = ? ', $userdata['user_id']) : '';

		$sql = 'DELETE FROM _forum_topics_fav WHERE topic_id = ?' . $delete_sql;
		sql_query(sql_filter($sql, $topic_id));
	}
	else
	{
		if ($mode == 'reply')
		{
			$sql = 'SELECT ban_userid
				FROM _banlist';
			$result = sql_rowset($sql);

			$user_id_sql = '';
			foreach ($result as $row) {
				if (isset($row['ban_userid']) && !empty($row['ban_userid'])) {
					$user_id_sql .= ', ' . $row['ban_userid'];
				}
			}

			$update_watched_sql = '';
			$bcc_list_ary = w();
			$usr_list_ary = w();

			$sql = 'SELECT DISTINCT u.user_id, u.user_email, u.user_lang
				FROM _forum_topics_fav tw
				INNER JOIN _members u ON tw.user_id = u.user_id
				INNER JOIN _members_group ug ON tw.user_id = ug.user_id
				LEFT OUTER JOIN _auth_access aa ON ug.group_id = aa.group_id, _forums f
				WHERE tw.topic_id = ?
					AND tw.user_id NOT IN (??, ??, ??)
					AND tw.notify_status = ?
					AND f.forum_id = ?
					AND u.user_active = 1
					AND (
						(aa.forum_id = ? AND aa.auth_read = 1)
						OR f.auth_read <= ?
						OR (u.user_level = ? AND f.auth_read = ?)
						OR u.user_level = ?
					)';
			if ($result = sql_rowset(sql_filter($sql, $topic_id, $userdata['user_id'], GUEST, $user_id_sql, TOPIC_WATCH_UN_NOTIFIED, $forum_id, $forum_id, AUTH_REG, USER_MOD, AUTH_MOD, USER_ADMIN))) {
				@set_time_limit(60);

				foreach ($result as $row) {
					if ($row['user_email'] != '') {
						$bcc_list_ary[$row['user_lang']][] = $row['user_email'];
					}

					$update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];
				}

				if (sizeof($bcc_list_ary)) {
					$emailer = new emailer();

					$server_name = trim($config['server_name']);
					$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://';

					$post_url = $server_protocol . $server_name . s_link('post', $post_id) . "#$post_id";

					$emailer->from($config['board_email']);
					$emailer->replyto($config['board_email']);

					$topic_title = unprepare_message($topic_title);

					@reset($bcc_list_ary);
					while (list($user_lang, $bcc_list) = each($bcc_list_ary))
					{
						$emailer->use_template('topic_notify', $user_lang);

						for ($i = 0; $i < count($bcc_list); $i++)
						{
							$emailer->bcc($bcc_list[$i]);
						}

						// The Topic_reply_notification lang string below will be used
						// if for some reason the mail template subject cannot be read
						// ... note it will not necessarily be in the posters own language!
						$emailer->set_subject($lang['Topic_reply_notification']);

						// This is a nasty kludge to remove the username var ... till (if?)
						// translators update their templates
						$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);

						$emailer->assign_vars(array(
							'EMAIL_SIG' => '',
							'SITENAME' => $config['sitename'],
							'TOPIC_TITLE' => $topic_title,

							'U_TOPIC' => $post_url,
							'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $script_name . '&' . POST_TOPIC_URL . "=$topic_id&unwatch=topic")
						);

//.........这里部分代码省略.........
开发者ID:nopticon,项目名称:rockr,代码行数:101,代码来源:functions_post.php

示例5: home

	function home() {
		global $core, $user, $style;
		
		$sql = 'SELECT *
			FROM _email
			WHERE email_active = 1
				AND (email_schedule > ??
				OR email_schedule = 0)
			ORDER BY email_priority, email_id
			LIMIT 1';
		if (!$email = sql_fieldrow(sql_filter($sql, time()))) {
			$this->e('No queue.');
		}
		
		set_time_limit(0);
		
		$sql = 'SELECT *
			FROM ??
			WHERE address_sent = 0
			ORDER BY address_id
			LIMIT ??';
		if ($members = sql_rowset(sql_filter($sql, $email['email_data'], $email['email_batch']))) {
			if (!$email['email_start']) {
				$sql = 'UPDATE _email SET email_start = ?
					WHERE email_id = ?';
				sql_query(sql_filter($sql, time(), $email['email_id']));
			}
		}
		
		$i = 0;
		$sent_to = array();
		
		foreach ($members as $row) {
			$address_account = trim($row['address_account']);
			
			if (!preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $address_account)) {
				$sql = 'UPDATE ?? SET address_sent = ?
					WHERE address_id = ?';
				sql_query(sql_filter($sql, $email['email_data'], 1, $row['address_id']));
				
				continue;
			}
			
			if (!$i) {
				include(XFS . 'core/emailer.php');
				$emailer = new emailer();
			}
			
			$emailer->use_template('mass');
			$emailer->format('html');
			
			$emailer->from($email['email_from'] . ' <' . $email['email_from_address'] . '>');
			$emailer->set_subject(entity_decode($email['email_subject']));
			$emailer->email_address($address_account);
			
			$name_compose = '';
			
			if (isset($row['address_name']) && !empty($row['address_name'])) {
				$row['address_name'] = preg_replace('/\s\s+/', ' ', $row['address_name']);
				$name_compose = ucwords(strtolower(trim($row['address_name'])));
				
				if (isset($row['address_last']) && !empty($row['address_last'])) {
					$row['address_last'] = preg_replace('/\s\s+/', ' ', $row['address_last']);
					$name_compose .= ' ' . ucwords(strtolower(trim($row['address_last'])));
				}
				
				if (!empty($name_compose)) {
					$name_gretting = '';
					
					if (isset($row['address_gender']) && !empty($row['address_gender'])) {
						switch ($row['address_gender']) {
							case 'Femenino':
								$name_by = 'a';
								break;
							case 'Masculino':
								$name_by = 'o';
								break;
							default:
								$name_gretting = $core->config['email_gretting'];
								break;
						}
					} else {
						if (strpos($name_compose, 'Sra.') !== false || strpos($name_compose, 'Srta.') !== false) {
							$name_by = 'a';
						} else if (strpos($name_compose, 'Sr.') !== false) {
							$name_by = 'o';
						} else {
							$name_gretting = $core->config['email_gretting'];
						}
					}
					
					if (empty($email['email_gretting'])) {
						$name_gretting = $core->config['email_gretting'];
					}
					
					if (!empty($name_gretting)) {
						$name_compose = $name_gretting . ' ' . $name_compose;
					} elseif (!empty($name_by)) {
						if (strpos($email['email_gretting'], '*') !== false) {
							$name_compose = str_replace('*', $name_by, $email['email_gretting']) . ' ' . $name_compose;
//.........这里部分代码省略.........
开发者ID:nopticon,项目名称:jade,代码行数:101,代码来源:_email.php

示例6: time

     //
     // Add to the users new pm counter
     //
     $sql = "UPDATE " . USERS_TABLE . "\r\n\t\t\t\tSET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "  \r\n\t\t\t\tWHERE user_id = " . $to_userdata['user_id'];
     if (!($status = $db->sql_query($sql))) {
         message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
     }
     if ($to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active']) {
         $script_name = preg_replace('/^\\/?(.*?)\\/?$/', "\\1", trim($board_config['script_path']));
         $script_name = $script_name != '' ? $script_name . '/privmsg.' . $phpEx : 'privmsg.' . $phpEx;
         $server_name = trim($board_config['server_name']);
         $server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
         $server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
         include $phpbb_root_path . 'includes/emailer.' . $phpEx;
         $emailer = new emailer($board_config['smtp_delivery']);
         $emailer->from($board_config['board_email']);
         $emailer->replyto($board_config['board_email']);
         $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
         $emailer->email_address($to_userdata['user_email']);
         $emailer->set_subject($lang['Notification_subject']);
         $emailer->assign_vars(array('USERNAME' => stripslashes($to_username), 'SENDER_USERNAME' => htmlspecialchars($userdata['username']), 'PM_SUBJECT' => $privmsg_subject, 'PM_MESSAGE' => $message_text, 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox'));
         $emailer->send();
         $emailer->reset();
     }
 }
 /*
 $template->assign_vars(array(
 	'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("privmsg.$phpEx?folder=inbox") . '">')
 );
 
 $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
开发者ID:Nekrofage,项目名称:FJR,代码行数:31,代码来源:privmsg.php

示例7: fatal_error

function fatal_error($mode = '404', $bp_message = '') {
	global $user, $config;

	$current_page = _page();
	$error = 'La p&aacute;gina <strong>' . $current_page . '</strong> ';

	$username = (@method_exists($user, 'd')) ? $user->d('username') : '';
	$bp_message .= nr(false, 2) . $current_page . nr(false, 2) . $username;

	switch ($mode) {
		case 'mysql':
			if (isset($config['default_lang']) && isset($user->lang)) {
				// Send email notification
				$emailer = new emailer();

				$emailer->from('info');
				$emailer->set_subject('MySQL error');
				$emailer->use_template('mcp_delete', $config['default_lang']);
				$emailer->email_address('info@rockrepublik.net');

				$emailer->assign_vars(array(
					'MESSAGE' => $bp_message,
					'TIME' => $user->format_date(time(), 'r'))
				);
				//$emailer->send();
				$emailer->reset();
			} else {
				$email_message = $bp_message . nr(false, 2) . date('r');
				$email_headers = "From: info@rockrepublik.net\nReturn-Path: " . $config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=iso-8859-1\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\n";
				//$result = @mail('info@rockrepublik.net', 'MySQL error', preg_replace("#(?<!\r)\n#s", "\n", $email_message), $email_headers, "-f{$config['board_email']}");
			}

			$title = 'Error del sistema';
			$error .= 'tiene un error';
			break;
		case '600':
			$title = 'Origen inv&aacute;lido';
			$error .= 'no puede ser accesada porque no se reconoce su IP de origen.';

			@error_log('[php client empty ip] File does not exist: ' . $current_page, 0);
			break;
		default:
			$title = 'Archivo no encontrado';
			$error .= 'no existe';
			$bp_message = '';

			status("404 Not Found");

			@error_log('[php client ' . $user->ip . ($user->d('username') ? ' - ' . $user->d('username') : '') . '] File does not exist: ' . $current_page, 0);
			break;
	}

	if ($mode != '600') {
		$error .= ', puedes regresar a<br /><a href="/">p&aacute;gina de inicio de Rock Republik</a> para encontrar informaci&oacute;n.';

		if (!empty($bp_message)) {
			$error .= '<br /><br />' . $bp_message;
		}
	}

	sql_close();

	$replaces = array(
		'PAGE_TITLE' => $title,
		'PAGE_MESSAGE' => $error
	);

	echo exception('error', $replaces);
	exit;
}
开发者ID:nopticon,项目名称:rockr,代码行数:70,代码来源:functions.php

示例8: main

    function main($action)
    {
        global $db, $config, $template, $images, $user, $lang;
        global $pafiledb_config, $debug;
        $file_id = request_var('file_id', 0);
        if (empty($file_id)) {
            message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
        }
        $sql = 'SELECT file_catid, file_name
			FROM ' . PA_FILES_TABLE . "\n\t\t\tWHERE file_id = {$file_id}";
        $result = $db->sql_query($sql);
        if (!($file_data = $db->sql_fetchrow($result))) {
            message_die(GENERAL_MESSAGE, $lang['File_not_exist']);
        }
        $db->sql_freeresult($result);
        if (!$this->auth[$file_data['file_catid']]['auth_email']) {
            if (!$user->data['session_logged_in']) {
                redirect(append_sid(CMS_PAGE_LOGIN . '?redirect=dload.' . PHP_EXT . '&action=email&file_id=' . $file_id, true));
            }
            $message = sprintf($lang['Sorry_auth_email'], $this->auth[$file_data['file_catid']]['auth_email_type']);
            message_die(GENERAL_MESSAGE, $message);
        }
        if (isset($_POST['submit'])) {
            // session id check
            $sid = request_post_var('sid', '');
            if (empty($sid) || $sid != $user->data['session_id']) {
                message_die(GENERAL_ERROR, 'INVALID_SESSION');
            }
            $error = false;
            $femail = request_var('femail', '');
            if (!empty($femail) && preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $femail)) {
                $user_email = $femail;
            } else {
                $error = true;
                $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Email_invalid'] : $lang['Email_invalid'];
            }
            $username = request_var('fname', '', true);
            $sender_name = request_var('sname', '', true);
            //if (!$user->data['session_logged_in'] || ($user->data['session_logged_in'] && ($sender_name != $user->data['username'])))
            if (!$user->data['session_logged_in']) {
                // Mighty Gorgon: is this really needed?
                /*
                include(IP_ROOT_PATH . 'includes/functions_validate.' . PHP_EXT);
                $result = validate_username($sender_name);
                if ($result['error'])
                {
                	$error = true;
                	$error_msg .= (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg'];
                }
                */
            } else {
                $sender_name = $user->data['username'];
            }
            if (!$user->data['session_logged_in']) {
                $semail = request_var('semail', '');
                if (!empty($semail) && preg_match('/^[a-z0-9\\.\\-_\\+]+@[a-z0-9\\-_]+\\.([a-z0-9\\-_]+\\.)*?[a-z]+$/is', $femail)) {
                    $sender_email = $semail;
                } else {
                    $error = true;
                    $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Email_invalid'] : $lang['Email_invalid'];
                }
            } else {
                $sender_email = $user->data['user_email'];
            }
            $subject = request_var('subject', '', true);
            $subject = htmlspecialchars_decode($subject, ENT_COMPAT);
            if (empty($subject)) {
                $error = true;
                $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_subject_email'] : $lang['Empty_subject_email'];
            }
            $message = request_var('message', '', true);
            // We need to check if HTML emails are enabled so we can correctly escape content and linebreaks
            $message = !empty($config['html_email']) ? nl2br($message) : htmlspecialchars_decode($message, ENT_COMPAT);
            if (empty($message)) {
                $error = true;
                $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_message_email'] : $lang['Empty_message_email'];
            }
            if (!$error) {
                include IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
                $emailer = new emailer();
                $emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
                $emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
                $emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
                $emailer->headers('X-AntiAbuse: User IP - ' . $user_ip);
                $emailer->use_template('profile_send_email', $user_lang);
                $emailer->to($user_email);
                $emailer->from($sender_email);
                $emailer->replyto($sender_email);
                $emailer->set_subject($subject);
                $emailer->assign_vars(array('SITENAME' => $config['sitename'], 'BOARD_EMAIL' => $config['board_email'], 'FROM_USERNAME' => $sender_name, 'TO_USERNAME' => $username, 'MESSAGE' => $message));
                $emailer->send();
                $emailer->reset();
                $message = $lang['Econf'] . '<br /><br />' . sprintf($lang['Click_return'], '<a href="' . append_sid('dload.' . PHP_EXT . '?action=file&amp;file_id=' . $file_id) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid(CMS_PAGE_HOME) . '">', '</a>');
                message_die(GENERAL_MESSAGE, $message);
            }
            if ($error) {
                message_die(GENERAL_MESSAGE, $error_msg);
            }
        }
        $this->generate_category_nav($file_data['file_catid']);
//.........这里部分代码省略.........
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:101,代码来源:pa_email.php

示例9: trim

     $friendemail = trim(stripslashes($_POST['friendemail']));
     if (!$_POST['friendname']) {
         $friendname = substr($friendemail, 0, strpos($_POST['friendemail'], "@"));
     }
 } else {
     $error = TRUE;
     $error_msg = "You have not entered a (valid) email address";
 }
 if (!$error) {
     include $phpbb_root_path . 'includes/emailer.' . $phpEx;
     $emailer = new emailer($board_config['smtp_delivery']);
     $email_headers = 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
     $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
     $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
     $email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n";
     $emailer->from($userdata['username'] . " <" . $userdata['user_email'] . ">");
     $emailer->replyto($userdata['username'] . " <" . $userdata['user_email'] . ">");
     $emailer->use_template('tellafriend_email', $userdata['user_lang']);
     $emailer->email_address($friendname . '<' . $friendemail . '>');
     $emailer->set_subject(trim(stripslashes($topic)));
     $emailer->extra_headers($email_headers);
     $emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'BOARD_EMAIL' => $board_config['board_email'], 'FROM_USERNAME' => $userdata['username'], 'TO_USERNAME' => $friendname, 'MESSAGE' => $message));
     $emailer->send();
     $emailer->reset();
     $template->assign_vars(array('META' => '<meta http-equiv="refresh" content="3;url=' . append_sid($_POST['link']) . '">'));
     $message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.{$phpEx}") . '">', '</a>');
     message_die(GENERAL_MESSAGE, $message);
 }
 if ($error) {
     $template->set_filenames(array('reg_header' => 'error_body.tpl'));
     $template->assign_vars(array('ERROR_MESSAGE' => $error_msg));
开发者ID:nmpetkov,项目名称:ZphpBB2,代码行数:31,代码来源:tellafriend.php

示例10: strlen

             message_die(GENERAL_MESSAGE, $lang['No_send_account_inactive']);
         }
         $username = $row['username'];
         $user_id = $row['user_id'];
         $user_actkey = make_rand_str(true);
         $key_len = 54 - strlen($server_url);
         $key_len = $str_len > 6 ? $key_len : 6;
         $user_actkey = substr($user_actkey, 0, $key_len);
         $user_password = make_rand_str(false);
         $sql = "UPDATE " . USERS_TABLE . "\n\t\t\t\tSET user_newpasswd = '" . md5($user_password) . "', user_actkey = '{$user_actkey}'\n\t\t\t\tWHERE user_id = " . $row['user_id'];
         if (!DB()->sql_query($sql)) {
             message_die(GENERAL_ERROR, 'Could not update new password information', '', __LINE__, __FILE__, $sql);
         }
         require FT_ROOT . 'includes/emailer.php';
         $emailer = new emailer($ft_cfg['smtp_delivery']);
         $emailer->from($ft_cfg['board_email']);
         $emailer->replyto($ft_cfg['board_email']);
         $emailer->use_template('user_activate_passwd', $row['user_lang']);
         $emailer->email_address($row['user_email']);
         $emailer->set_subject($lang['New_password_activation']);
         $emailer->assign_vars(array('SITENAME' => $ft_cfg['sitename'], 'USERNAME' => $username, 'PASSWORD' => $user_password, 'EMAIL_SIG' => !empty($ft_cfg['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $ft_cfg['board_email_sig']) : '', 'U_ACTIVATE' => $server_url . '?mode=activate&' . POST_USERS_URL . '=' . $user_id . '&act_key=' . $user_actkey));
         $emailer->send();
         $emailer->reset();
         $template->assign_vars(array('META' => '<meta http-equiv="refresh" content="15;url=' . append_sid("index.php") . '">'));
         $message = $lang['Password_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.php") . '">', '</a>');
         message_die(GENERAL_MESSAGE, $message);
     } else {
         message_die(GENERAL_MESSAGE, $lang['No_email_match']);
     }
 } else {
     message_die(GENERAL_ERROR, 'Could not obtain user information for sendpassword', '', __LINE__, __FILE__, $sql);
开发者ID:forummaks,项目名称:forum_maks,代码行数:31,代码来源:sendpasswd.php

示例11: trim

 } else {
     $error = TRUE;
     $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_subject_email'] : $lang['Empty_subject_email'];
 }
 if (!empty($HTTP_POST_VARS['message'])) {
     $message = trim(stripslashes($HTTP_POST_VARS['message']));
 } else {
     $error = TRUE;
     $error_msg = !empty($error_msg) ? $error_msg . '<br />' . $lang['Empty_message_email'] : $lang['Empty_message_email'];
 }
 if (!$error) {
     $sql = "UPDATE " . USERS_TABLE . " \n\t\t\t\t\t\tSET user_emailtime = " . time() . " \n\t\t\t\t\t\tWHERE user_id = " . $userdata['user_id'];
     if ($result = $db->sql_query($sql)) {
         include $phpbb_root_path . 'includes/emailer.' . $phpEx;
         $emailer = new emailer($board_config['smtp_delivery']);
         $emailer->from($userdata['user_email']);
         $emailer->replyto($userdata['user_email']);
         $email_headers = 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
         $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
         $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
         $email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\n";
         $emailer->use_template('profile_send_email', $user_lang);
         $emailer->email_address($user_email);
         $emailer->set_subject($subject);
         $emailer->extra_headers($email_headers);
         $emailer->assign_vars(array('SITENAME' => $board_config['sitename'], 'BOARD_EMAIL' => $board_config['board_email'], 'FROM_USERNAME' => $userdata['username'], 'TO_USERNAME' => $username, 'MESSAGE' => $message));
         $emailer->send();
         $emailer->reset();
         if (!empty($HTTP_POST_VARS['cc_email'])) {
             $emailer->from($userdata['user_email']);
             $emailer->replyto($userdata['user_email']);
开发者ID:andrewroth,项目名称:winbolo,代码行数:31,代码来源:usercp_email.php

示例12: adr_send_pm

function adr_send_pm($dest_user, $subject, $message, $check_from_id = '')
{
    global $db, $phpbb_root_path, $phpEx, $lang, $user_ip, $board_config, $userdata;
    $dest_user = intval($dest_user);
    $msg_time = time();
    $from_id = $check_from_id === '' ? intval($userdata['user_id']) : $check_from_id;
    $html_on = 1;
    $bbcode_on = 1;
    $smilies_on = 1;
    include_once $phpbb_root_path . 'includes/functions_post.' . $phpEx;
    include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
    $privmsg_subject = trim(strip_tags($subject));
    $bbcode_uid = make_bbcode_uid();
    $privmsg_message = trim(strip_tags($message));
    // APM compliance
    if (defined('PRIVMSGA_TABLE')) {
        include_once $phpbb_root_path . 'includes/functions_messages.' . $phpEx;
        send_pm(0, '', $dest_user, $privmsg_subject, $privmsg_message, '');
    } else {
        $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active\r\n\t\t\t FROM " . USERS_TABLE . "\r\n\t\t\t WHERE user_id = {$dest_user} ";
        if (!($result = $db->sql_query($sql))) {
            $error = TRUE;
            $error_msg = $lang['No_such_user'];
        }
        $to_userdata = $db->sql_fetchrow($result);
        $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time\r\n\t\t\tFROM " . PRIVMSGS_TABLE . "\r\n\t\t\tWHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "\r\n\t\t\t  OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " \r\n\t\t\t\tOR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )\r\n\t\t\tAND privmsgs_to_userid = {$dest_user} ";
        if (!($result = $db->sql_query($sql))) {
            message_die(GENERAL_MESSAGE, $lang['No_such_user']);
        }
        $sql_priority = SQL_LAYER == 'mysql' ? 'LOW_PRIORITY' : '';
        if ($inbox_info = $db->sql_fetchrow($result)) {
            if ($inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs']) {
                $sql = "SELECT privmsgs_id FROM " . PRIVMSGS_TABLE . "\r\n\t\t\t\t\tWHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "\r\n\t\t\t\t\tOR privmsgs_type = " . PRIVMSGS_READ_MAIL . "\r\n\t\t\t\t\tOR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "  )\r\n\t\t\t\t\tAND privmsgs_date = " . $inbox_info['oldest_post_time'] . "\r\n\t\t\t\t\tAND privmsgs_to_userid = {$dest_user} ";
                if (!($result = $db->sql_query($sql))) {
                    message_die(GENERAL_ERROR, 'Could not find oldest privmsgs (inbox)', '', __LINE__, __FILE__, $sql);
                }
                $old_privmsgs_id = $db->sql_fetchrow($result);
                $old_privmsgs_id = $old_privmsgs_id['privmsgs_id'];
                $sql = "DELETE {$sql_priority} FROM " . PRIVMSGS_TABLE . "\r\n\t\t\t\t\tWHERE privmsgs_id = {$old_privmsgs_id}";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs (inbox)' . $sql, '', __LINE__, __FILE__, $sql);
                }
                $sql = "DELETE {$sql_priority} FROM " . PRIVMSGS_TEXT_TABLE . "\r\n\t\t\t\t\tWHERE privmsgs_text_id = {$old_privmsgs_id}";
                if (!$db->sql_query($sql)) {
                    message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql);
                }
            }
        }
        $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " \r\n\t\t\t(privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies)\r\n\t\t\tVALUES ( 1 , '" . str_replace("\\'", "''", addslashes($privmsg_subject)) . "' , " . $from_id . ", " . $to_userdata['user_id'] . ", {$msg_time}, '{$user_ip}' , {$html_on}, {$bbcode_on}, {$smilies_on})";
        if (!$db->sql_query($sql_info)) {
            message_die(GENERAL_ERROR, 'Could not delete oldest privmsgs text (inbox)', '', __LINE__, __FILE__, $sql_info);
        }
        $privmsg_sent_id = $db->sql_nextid();
        $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)\r\n\t\t\tVALUES ({$privmsg_sent_id}, '" . $bbcode_uid . "', '" . str_replace("\\'", "''", addslashes($privmsg_message)) . "')";
        if (!$db->sql_query($sql, END_TRANSACTION)) {
            message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql);
        }
        $sql = "UPDATE " . USERS_TABLE . "\r\n\t\t\tSET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " \r\n\t\t\tWHERE user_id = " . $to_userdata['user_id'];
        if (!($status = $db->sql_query($sql))) {
            message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
        }
        if ($to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active']) {
            // have the mail sender infos
            $script_name = preg_replace('/^\\/?(.*?)\\/?$/', "\\1", trim($board_config['script_path']));
            $script_name = $script_name != '' ? $script_name . '/privmsg.' . $phpEx : 'privmsg.' . $phpEx;
            $server_name = trim($board_config['server_name']);
            $server_protocol = $board_config['cookie_secure'] ? 'https://' : 'http://';
            $server_port = $board_config['server_port'] != 80 ? ':' . trim($board_config['server_port']) . '/' : '/';
            include_once $phpbb_root_path . './includes/emailer.' . $phpEx;
            $emailer = new emailer($board_config['smtp_delivery']);
            if ($board_config['version'] == '.0.5' || $board_config['version'] == '.0.6' || $board_config['version'] == '.0.7' || $board_config['version'] == '.0.8' || $board_config['version'] == '.0.9') {
                $emailer->from($board_config['board_email']);
                $emailer->replyto($board_config['board_email']);
                $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
            } else {
                $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";
                $emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
                $emailer->extra_headers($email_headers);
            }
            $emailer->email_address($to_userdata['user_email']);
            $emailer->set_subject($lang['Notification_subject']);
            $emailer->assign_vars(array('USERNAME' => $to_username, 'SITENAME' => $board_config['sitename'], 'EMAIL_SIG' => !empty($board_config['board_email_sig']) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox'));
            $emailer->send();
            $emailer->reset();
        }
    }
    return;
}
开发者ID:Nekrofage,项目名称:FJR,代码行数:88,代码来源:adr_functions_communicate.php

示例13: emailer

    $sql = 'SELECT username, user_warnings, user_email, user_lang FROM ' . USERS_TABLE . ' WHERE user_id = "' . $poster_id . '"';
    $result = $db->sql_query($sql);
    $warning_data = $db->sql_fetchrow($result);
    if (!empty($warning_data['user_email'])) {
        $server_url = create_server_url();
        $viewtopic_server_url = $server_url . CMS_PAGE_VIEWTOPIC;
        $from_email = $user->data['user_email'] && $user->data['user_allow_viewemail'] ? $user->data['user_email'] : $config['board_email'];
        include_once IP_ROOT_PATH . 'includes/emailer.' . PHP_EXT;
        $emailer = new emailer();
        $emailer->headers('X-AntiAbuse: Board servername - ' . trim($config['server_name']));
        $emailer->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
        $emailer->headers('X-AntiAbuse: Username - ' . $user->data['username']);
        $emailer->headers('X-AntiAbuse: User IP - ' . $user_ip);
        $emailer->use_template($e_temp, $warning_data['user_lang']);
        $emailer->to($warning_data['user_email']);
        $emailer->from($from_email);
        $emailer->replyto($from_email);
        //$emailer->set_subject($e_subj);
        $email_sig = create_signature($config['board_email_sig']);
        $emailer->assign_vars(array('SITENAME' => $config['sitename'], 'WARNINGS' => $warning_data['user_warnings'], 'TOTAL_WARN' => $config['max_user_bancard'], 'POST_URL' => $viewtopic_server_url . '?' . $forum_id_append . $topic_id_append . POST_POST_URL . '=' . $post_id . '#p' . $post_id, 'EMAIL_SIG' => $email_sig, 'WARNER' => $user->data['username'], 'BLOCK_TIME' => $block_time, 'WARNED_POSTER' => $warning_data['username']));
        $emailer->send();
        $emailer->reset();
    } else {
        $message .= '<br /><br />' . $lang['user_no_email'];
    }
} elseif ($already_banned) {
    $message = $lang['user_already_banned'];
} else {
    $message = 'Error in card.' . PHP_EXT;
}
$cache->destroy_datafiles(array('_ranks'), MAIN_CACHE_FOLDER, 'data', false);
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:card.php

示例14: _email

	public function _email() {
		if ($this->make) {
			return;
		}

		if (empty($this->data['email'])) {
			fatal_error();
		}

		if (!$this->auth['user']) {
			do_login();
		}

		global $user, $config;

		$error_msg = '';
		$subject = '';
		$message = '';
		$current_time = time();

		if (_button()) {
			$subject = request_var('subject', '');
			$message = request_var('message', '', true);

			if (empty($subject) || empty($message)) {
				$error_msg .= (($error_msg != '') ? '<br />' : '') . lang('fields_empty');
			}

			if (empty($error_msg)) {
				$sql = 'UPDATE _artists SET last_email = ?, last_email_user = ?
					WHERE ub = ?';
				sql_query(sql_filter($sql, $current_time, $user->d('user_id'), $this->data['ub']));

				$emailer = new emailer($config['smtp_delivery']);

				$emailer->from($user->d('user_email'));

				$email_headers = 'X-AntiAbuse: User_id - ' . $user->d('user_id') . nr();
				$email_headers .= 'X-AntiAbuse: Username - ' . $user->d('username') . nr();
				$email_headers .= 'X-AntiAbuse: User IP - ' . $user->ip . nr();

				$emailer->use_template('mmg_send_email', $config['default_lang']);
				$emailer->email_address($this->data['email']);
				$emailer->set_subject($subject);
				$emailer->extra_headers($email_headers);

				$emailer->assign_vars(array(
					'SITENAME' => $config['sitename'],
					'BOARD_EMAIL' => $config['board_email'],
					'FROM_USERNAME' => $user->d('username'),
					'UB_NAME' => $this->data['name'],
					'MESSAGE' => $message
				));
				$emailer->send();
				$emailer->reset();

				redirect(s_link('a', $this->data['subdomain']));
			}
		}

		if ($error_msg != '') {
			_style('error');
		}

		v_style(array(
			'ERROR_MESSAGE' => $error_msg,

			'SUBJECT' => $subject,
			'MESSAGE' => $message)
		);

		return;
	}
开发者ID:nopticon,项目名称:rockr,代码行数:73,代码来源:artists.php

示例15: emailer

 }
 include '../lib/emailer.php';
 //
 // Let's do some checking to make sure that mass mail functions
 // are working in win32 versions of php.
 //
 $board_config['smtp_delivery'] = 0;
 if (preg_match('/[c-z]:\\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery']) {
     $ini_val = @phpversion() >= '4.0.0' ? 'ini_get' : 'get_cfg_var';
     // We are running on windows, force delivery to use our smtp functions
     // since php's are broken by default
     $board_config['smtp_delivery'] = 1;
     $board_config['smtp_host'] = @$ini_val('SMTP');
 }
 $emailer = new emailer($board_config['smtp_delivery']);
 $emailer->from(EMAIL_ADMIN);
 $emailer->replyto(EMAIL_ADMIN);
 for ($i = 0; $i < count($bcc_list); $i++) {
     $emailer->bcc($bcc_list[$i]);
 }
 $email_headers = 'X-AntiAbuse: Board servername - Asterisk 2 billing\\n';
 $email_headers .= 'X-AntiAbuse: User_id - 1\\n';
 $email_headers .= 'X-AntiAbuse: Username - Areski\\n';
 $email_headers .= 'X-AntiAbuse: User IP - 192.168.1.241\\n';
 $emailer->use_template($message);
 $emailer->email_address(EMAIL_ADMIN);
 $emailer->set_subject($subject);
 $emailer->extra_headers($email_headers);
 $emailer->assign_vars(array('SITENAME' => 'a2billing', 'BOARD_EMAIL' => EMAIL_ADMIN, 'MESSAGE' => 'Hey it is a message, just to watch working'));
 $result = $emailer->send();
 $emailer->reset();
开发者ID:sayemk,项目名称:a2billing,代码行数:31,代码来源:A2B_mass_mail.php


注:本文中的emailer::from方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。