本文整理汇总了PHP中Mail::send_from_properties方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::send_from_properties方法的具体用法?PHP Mail::send_from_properties怎么用?PHP Mail::send_from_properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::send_from_properties方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Mail
function test_send_from_properties()
{
$msg = new Mail();
$mail_to = 'to_one@test.fr; to_two@test.fr';
$mail_from = 'from_one@test.fr; from_two@test.fr';
$mail_objet = 'objet';
$mail_contents = 'contents';
$ret = $msg->send_from_properties($mail_to, $mail_objet, $mail_contents, $mail_from);
if (ereg("127.0.0.1", $_SERVER['SERVER_ADDR'])) {
self::assertFalse($ret);
} else {
self::assertTrue($ret);
}
$ret = $msg->send_from_properties($mail_to, $mail_objet, $mail_contents, $mail_from);
if (ereg("127.0.0.1", $_SERVER['SERVER_ADDR'])) {
self::assertFalse($ret);
} else {
self::assertTrue($ret);
}
$mail_sender = 'visiteur';
$ret = $msg->send_from_properties($mail_to, $mail_objet, $mail_contents, $mail_from, $mail_sender);
if (ereg("127.0.0.1", $_SERVER['SERVER_ADDR'])) {
self::assertFalse($ret);
} else {
self::assertTrue($ret);
}
$mail_from = 'from_bidon';
$mail_sender = 'visiteur';
$ret = $msg->send_from_properties($mail_to, $mail_objet, $mail_contents, $mail_from, $mail_sender);
self::assertFalse($ret);
}
示例2: time
function Add_msg($idtopic, $idcat, $contents, $title, $last_page, $last_page_rewrite, $new_topic = false)
{
global $CONFIG, $Sql, $User, $CAT_FORUM, $LANG;
##### Insertion message #####
$last_timestamp = time();
$Sql->query_inject("INSERT INTO " . PREFIX . "forum_msg (idtopic, user_id, contents, timestamp, timestamp_edit, user_id_edit, user_ip) VALUES ('" . $idtopic . "', '" . $User->get_attribute('user_id') . "', '" . strparse($contents) . "', '" . $last_timestamp . "', '0', '0', '" . USER_IP . "')", __LINE__, __FILE__);
$last_msg_id = $Sql->insert_id("SELECT MAX(id) FROM " . PREFIX . "forum_msg");
$Sql->query_inject("UPDATE " . PREFIX . "forum_topics SET " . ($new_topic ? '' : 'nbr_msg = nbr_msg + 1, ') . "last_user_id = '" . $User->get_attribute('user_id') . "', last_msg_id = '" . $last_msg_id . "', last_timestamp = '" . $last_timestamp . "' WHERE id = '" . $idtopic . "'", __LINE__, __FILE__);
$Sql->query_inject("UPDATE " . PREFIX . "forum_cats SET last_topic_id = '" . $idtopic . "', nbr_msg = nbr_msg + 1" . ($new_topic ? ', nbr_topic = nbr_topic + 1' : '') . " WHERE id_left <= '" . $CAT_FORUM[$idcat]['id_left'] . "' AND id_right >= '" . $CAT_FORUM[$idcat]['id_right'] . "' AND level <= '" . $CAT_FORUM[$idcat]['level'] . "'", __LINE__, __FILE__);
$Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET user_msg = user_msg + 1 WHERE user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__);
mark_topic_as_read($idtopic, $last_msg_id, $last_timestamp);
##### Gestion suivi du sujet mp/mail #####
if (!$new_topic) {
$previous_msg_id = $Sql->query("SELECT MAX(id) FROM " . PREFIX . "forum_msg WHERE idtopic = '" . $idtopic . "' AND id < '" . $last_msg_id . "'", __LINE__, __FILE__);
$title_subject = html_entity_decode($title, ENT_COMPAT, 'ISO-8859-1');
$title_subject_pm = '[url=' . HOST . DIR . '/forum/topic' . url('.php?id=' . $idtopic . $last_page, '-' . $idtopic . $last_page_rewrite . '.php') . '#m' . $previous_msg_id . ']' . $title_subject . '[/url]';
if ($User->get_attribute('user_id') > 0) {
$pseudo = $Sql->query("SELECT login FROM " . DB_TABLE_MEMBER . " WHERE user_id = '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__);
$pseudo_pm = '[url=' . HOST . DIR . '/member/member.php?id=' . $User->get_attribute('user_id') . ']' . $pseudo . '[/url]';
} else {
$pseudo = $LANG['guest'];
$pseudo_pm = $LANG['guest'];
}
$next_msg_link = HOST . DIR . '/forum/topic' . url('.php?id=' . $idtopic . $last_page, '-' . $idtopic . $last_page_rewrite . '.php') . '#m' . $previous_msg_id;
$preview_contents = substr($contents, 0, 300);
import('io/mail');
$Mail = new Mail();
import('members/pm');
$Privatemsg = new PrivateMsg();
$max_time = time() - $CONFIG['site_session_invit'];
$result = $Sql->query_while("SELECT m.user_id, m.login, m.user_mail, tr.pm, tr.mail, v.last_view_id\n\t\t\tFROM " . PREFIX . "forum_track tr\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = tr.user_id\n\t\t\tLEFT JOIN " . PREFIX . "forum_view v ON v.idtopic = '" . $idtopic . "' AND v.user_id = tr.user_id\n\t\t\tWHERE tr.idtopic = '" . $idtopic . "' AND v.last_view_id IS NOT NULL AND m.user_id != '" . $User->get_attribute('user_id') . "'", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
if ($row['last_view_id'] == $previous_msg_id && $row['mail'] == '1') {
$Mail->send_from_properties($row['user_mail'], $LANG['forum_mail_title_new_post'], sprintf($LANG['forum_mail_new_post'], $row['login'], $title_subject, $User->get_attribute('login'), $preview_contents, $next_msg_link, HOST . DIR . '/forum/action.php?ut=' . $idtopic . '&trt=1', 1), $CONFIG['mail_exp']);
}
if ($row['last_view_id'] == $previous_msg_id && $row['pm'] == '1') {
$Privatemsg->start_conversation($row['user_id'], addslashes($LANG['forum_mail_title_new_post']), sprintf($LANG['forum_mail_new_post'], $row['login'], $title_subject_pm, $User->get_attribute('login'), $preview_contents, '[url]' . $next_msg_link . '[/url]', '[url]' . HOST . DIR . '/forum/action.php?ut=' . $idtopic . '&trt=2[/url]'), '-1', SYSTEM_PM);
}
}
forum_generate_feeds();
}
return $last_msg_id;
}
示例3: sprintf
}
}
if ($CONFIG_USER['activ_mbr'] == 1) {
$l_register_confirm = $LANG['confirm_register'] . '<br />' . $LANG['register_valid_email_confirm'];
$valid = sprintf($LANG['register_valid_email'], HOST . DIR . '/member/register.php?key=' . $activ_mbr);
} elseif ($CONFIG_USER['activ_mbr'] == 2) {
$l_register_confirm = $LANG['confirm_register'] . '<br />' . $LANG['register_valid_admin'];
$valid = $LANG['register_valid_admin'];
} else {
$l_register_confirm = $LANG['confirm_register'] . '<br />' . $LANG['register_ready'];
$valid_mail = '';
$valid = '';
}
import('io/mail');
$Mail = new Mail();
$Mail->send_from_properties($user_mail, sprintf($LANG['register_title_mail'], $CONFIG['site_name']), sprintf($LANG['register_mail'], $login, $CONFIG['site_name'], $CONFIG['site_name'], stripslashes($login), $password, $valid, $CONFIG['sign']), $CONFIG['mail_exp']);
if ($CONFIG_USER['activ_mbr'] == 0) {
$Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET last_connect='" . time() . "' WHERE user_id = '" . $last_mbr_id . "'", __LINE__, __FILE__);
$Session->start($last_mbr_id, $password, 0, SCRIPT, QUERY_STRING, TITLE, 1);
}
unset($password, $password_hash);
redirect_confirm(get_start_page(), sprintf($l_register_confirm, stripslashes($login)), 5);
}
} elseif (!empty($_POST['register_valid']) && $password !== $password_bis) {
redirect(HOST . DIR . '/member/register' . url('.php?error=pass_same') . '#errorh');
} else {
redirect(HOST . DIR . '/member/register' . url('.php?error=incomplete') . '#errorh');
}
} else {
redirect(HOST . DIR . '/member/register' . url('.php?error=lenght_mini') . '#errorh');
}
示例4: import
if (count($matching_alerts) == 1) {
$alert = $matching_alerts[0];
$alert->set_status(ADMIN_ALERT_STATUS_PROCESSED);
AdministratorAlertService::save_alert($alert);
}
$Cache->Generate_file('stats');
}
$Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET login = '" . $login . "', level = '" . $MEMBER_LEVEL . "', user_lang = '" . $user_lang . "', user_theme = '" . $user_theme . "', user_mail = '" . $user_mail . "', user_show_mail = " . $user_show_mail . ", user_editor = '" . $user_editor . "', user_timezone = '" . $user_timezone . "', user_local = '" . $user_local . "', " . $user_avatar . "user_msn = '" . $user_msn . "', user_yahoo = '" . $user_yahoo . "', user_web = '" . $user_web . "', user_occupation = '" . $user_occupation . "', user_hobbies = '" . $user_hobbies . "', user_desc = '" . $user_desc . "', user_sex = '" . $user_sex . "', user_born = '" . $user_born . "', user_sign = '" . $user_sign . "', user_warning = '" . $user_warning . "', user_readonly = '" . $user_readonly . "', user_ban = '" . $user_ban . "', user_aprob = '" . $user_aprob . "' WHERE user_id = '" . $id_post . "'", __LINE__, __FILE__);
if ($member_infos['level'] != $MEMBER_LEVEL) {
$Sql->query_inject("UPDATE " . DB_TABLE_SESSIONS . " SET level = '" . $MEMBER_LEVEL . "' WHERE user_id = '" . $id_post . "'", __LINE__, __FILE__);
}
if ($user_ban > 0) {
$Sql->query_inject("DELETE FROM " . DB_TABLE_SESSIONS . " WHERE user_id = '" . $id_post . "'", __LINE__, __FILE__);
import('io/mail');
$Mail = new Mail();
$Mail->send_from_properties($user_mail, addslashes($LANG['ban_title_mail']), sprintf(addslashes($LANG['ban_mail']), HOST, addslashes($CONFIG['sign'])), $CONFIG['mail_exp']);
}
$extend_field_exist = $Sql->query("SELECT COUNT(*) FROM " . DB_TABLE_MEMBER_EXTEND_CAT . " WHERE display = 1", __LINE__, __FILE__);
if ($extend_field_exist > 0) {
$req_update = '';
$req_field = '';
$req_insert = '';
$result = $Sql->query_while("SELECT field_name, field, possible_values\n\t\t\t\t\tFROM " . DB_TABLE_MEMBER_EXTEND_CAT . "\n\t\t\t\t\tWHERE display = 1", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
$field = isset($_POST[$row['field_name']]) ? $_POST[$row['field_name']] : '';
if ($row['field'] == 2) {
$field = strparse($field);
} elseif ($row['field'] == 4) {
$array_field = is_array($field) ? $field : array();
$field = '';
foreach ($array_field as $value) {
示例5: array
$theme_array_bdd = array();
$result = $Sql->query_while("SELECT theme \n\tFROM " . DB_TABLE_THEMES . "", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result)) {
if (array_search($row['theme'], $tpl_array) !== false) {
$theme_array_bdd[] = $row['theme'];
}
}
$Sql->query_close($result);
foreach ($theme_array_bdd as $theme_array => $theme_value) {
$theme_info = load_ini_file('../templates/' . $theme_value . '/config/', get_ulang());
if ($theme_info) {
$theme_name = !empty($theme_info['name']) ? $theme_info['name'] : $theme_value;
$selected = $theme_value == $CONFIG['theme'] ? 'selected="selected"' : '';
$Template->assign_block_vars('select', array('THEME' => '<option value="' . $theme_value . '" ' . $selected . '>' . $theme_name . '</option>'));
}
}
$Template->pparse('admin_config');
}
if (!empty($_GET['unlock'])) {
import('io/mail');
$Mail = new Mail();
$unlock_admin_clean = substr(strhash(uniqid(mt_rand(), true)), 0, 18);
$unlock_admin = strhash($unlock_admin_clean);
$CONFIG['unlock_admin'] = $unlock_admin;
$Sql->query_inject("UPDATE " . DB_TABLE_CONFIGS . " SET value = '" . addslashes(serialize($CONFIG)) . "' WHERE name = 'config'", __LINE__, __FILE__);
###### Régénération du cache $CONFIG #######
$Cache->Generate_file('config');
$Mail->send_from_properties($User->get_attribute('user_mail'), $LANG['unlock_title_mail'], sprintf($LANG['unlock_mail'], $unlock_admin_clean), $CONFIG['mail_exp']);
redirect(HOST . DIR . '/admin/admin_config.php?adv=1&mail=1');
}
require_once '../admin/admin_footer.php';
示例6: retrieve
require_once '../contact/contact_begin.php';
require_once '../kernel/header.php';
$mail_from = retrieve(POST, 'mail_email', '', TSTRING_UNCHANGE);
$mail_object = retrieve(POST, 'mail_object', '', TSTRING_UNCHANGE);
$mail_contents = retrieve(POST, 'mail_contents', '', TSTRING_UNCHANGE);
$mail_valid = retrieve(POST, 'mail_valid', '');
$get_error = '';
import('util/captcha');
$captcha = new Captcha();
$captcha->set_difficulty($CONFIG_CONTACT['contact_difficulty_verifcode']);
###########################Envoi##############################
if (!empty($mail_valid)) {
if (!$CONFIG_CONTACT['contact_verifcode'] || $captcha->is_valid()) {
import('io/mail');
$mail = new Mail();
if ($mail->send_from_properties($CONFIG['mail'], $mail_object, $mail_contents, $mail_from, '', 'user')) {
$get_error = 'success';
} else {
$get_error = 'error';
}
} else {
$get_error = 'verif';
}
} elseif (!empty($_POST['mail_valid']) && (empty($mail_email) || empty($mail_contents))) {
$get_error = 'incomplete';
}
###########################Affichage##############################
$Template->set_filenames(array('contact' => 'contact/contact.tpl'));
if ($get_error == 'incomplete') {
$Errorh->handler($LANG['e_incomplete'], E_USER_NOTICE);
} elseif ($get_error == 'verif') {
示例7: retrieve
$forget = retrieve(POST, 'forget', '');
if (!$User->check_level(MEMBER_LEVEL)) {
if (!$activ_confirm) {
$Template->set_filenames(array('forget' => 'member/forget.tpl'));
if (!empty($forget)) {
$user_mail = retrieve(POST, 'mail', '');
$login = retrieve(POST, 'name', '');
if (!empty($user_mail) && check_mail($user_mail)) {
$user_id = $Sql->query("SELECT user_id FROM " . DB_TABLE_MEMBER . " WHERE user_mail = '" . $user_mail . "' AND login = '" . $login . "'", __LINE__, __FILE__);
if (!empty($user_id)) {
$new_pass = substr(strhash(uniqid(rand(), true)), 0, 6);
$activ_pass = substr(strhash(uniqid(rand(), true)), 0, 30);
$Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET activ_pass = '" . $activ_pass . "', new_pass = '" . strhash($new_pass) . "' WHERE user_id = '" . $user_id . "'", __LINE__, __FILE__);
import('io/mail');
$Mail = new Mail();
$Mail->send_from_properties($user_mail, $LANG['forget_mail_activ_pass'], sprintf($LANG['forget_mail_pass'], $login, HOST, HOST . DIR, $user_id, $activ_pass, $new_pass, $CONFIG['sign']), $CONFIG['mail_exp']);
redirect(HOST . DIR . '/member/forget.php?error=forget_mail_send');
} else {
$Errorh->handler($LANG['e_mail_forget'], E_USER_NOTICE);
}
} else {
$Errorh->handler($LANG['e_incomplete'], E_USER_NOTICE);
}
}
$get_error = retrieve(GET, 'error', '', TSTRING_UNCHANGE);
$errno = E_USER_NOTICE;
switch ($get_error) {
case 'forget_mail_send':
$errstr = $LANG['e_forget_mail_send'];
break;
case 'forget_echec_change':