本文整理汇总了PHP中Mailer::set_from方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::set_from方法的具体用法?PHP Mailer::set_from怎么用?PHP Mailer::set_from使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mailer
的用法示例。
在下文中一共展示了Mailer::set_from方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Mailer
}
if (!($admin_id = $result->column('admin_id'))) {
$error = TRUE;
$msg_error[] = $lang['Message']['Error_sendpass'];
}
if (!$error) {
$new_password = generate_key(12);
require WAMAILER_DIR . '/class.mailer.php';
$mailer = new Mailer(WA_ROOTDIR . '/language/email_' . $nl_config['language'] . '/');
if ($nl_config['use_smtp']) {
$mailer->smtp_path = WAMAILER_DIR . '/';
$mailer->use_smtp($nl_config['smtp_host'], $nl_config['smtp_port'], $nl_config['smtp_user'], $nl_config['smtp_pass']);
}
$mailer->set_charset($lang['CHARSET']);
$mailer->set_format(FORMAT_TEXTE);
$mailer->set_from($email);
$mailer->set_address($email);
$mailer->set_subject($lang['Subject_email']['New_pass']);
$mailer->use_template('new_admin_pass', array('PSEUDO' => $login, 'PASSWORD' => $new_password));
if (!$mailer->send()) {
trigger_error('Failed_sending', ERROR);
}
$db->query("UPDATE " . ADMIN_TABLE . "\n\t\t\t\tSET admin_pwd = '" . md5($new_password) . "'\n\t\t\t\tWHERE admin_id = " . $admin_id);
$output->message('IDs_sended');
}
}
$output->page_header();
$output->set_filenames(array('body' => 'sendpass_body.tpl'));
$output->assign_vars(array('TITLE' => $lang['Title']['sendpass'], 'L_LOGIN' => $lang['Login'], 'L_EMAIL' => $lang['Email_address'], 'L_VALID_BUTTON' => $lang['Button']['valid'], 'S_LOGIN' => htmlspecialchars($login), 'S_EMAIL' => htmlspecialchars($email)));
$output->pparse('body');
$output->page_footer();
示例2: Mailer
}
}
if ($set_password == true) {
$sql = "SELECT admin_login\n\t\t\t\tFROM " . ADMIN_TABLE . "\n\t\t\t\tWHERE admin_id = " . $admin_id;
if (!($result = $db->query($sql))) {
trigger_error('Impossible de récupérer le pseudo de cet utilisateur', ERROR);
}
$pseudo = $result->column('admin_login');
$mailer = new Mailer(WA_ROOTDIR . '/language/email_' . $nl_config['language'] . '/');
if ($nl_config['use_smtp']) {
$mailer->smtp_path = WAMAILER_DIR . '/';
$mailer->use_smtp($nl_config['smtp_host'], $nl_config['smtp_port'], $nl_config['smtp_user'], $nl_config['smtp_pass']);
}
$mailer->set_charset($lang['CHARSET']);
$mailer->set_format(FORMAT_TEXTE);
$mailer->set_from($admindata['admin_email'], $admindata['admin_login']);
$mailer->set_address($email);
$mailer->set_subject($lang['Subject_email']['New_pass']);
$mailer->use_template('new_admin_pass', array('PSEUDO' => $pseudo, 'PASSWORD' => $new_pass));
if (!$mailer->send()) {
trigger_error(sprintf($lang['Message']['Failed_sending2'], $mailer->msg_error), ERROR);
}
}
$output->redirect('./admin.php', 6);
$message = $lang['Message']['Profile_updated'];
$message .= '<br /><br />' . sprintf($lang['Click_return_profile'], '<a href="' . sessid('./admin.php?admin_id=' . $admin_id) . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . sessid('./index.php') . '">', '</a>');
$output->message($message);
}
}
$admin_box = '';
示例3: unhtmlspecialchars
//
if (preg_match('/[\\x80-\\x9F]/', $row['log_subject']) || preg_match('/[\\x80-\\x9F]/', $row['log_body_text']) || preg_match('/[\\x80-\\x9F]/', $row['log_body_html'])) {
if (TRANSLITE_INVALID_CHARS == false) {
$row['log_subject'] = wan_utf8_encode($row['log_subject']);
$row['log_body_text'] = wan_utf8_encode($row['log_body_text']);
$row['log_body_html'] = wan_utf8_encode($row['log_body_html']);
$lang['Label_link'] = $lang['Label_link::utf8'];
$mailer->set_charset('UTF-8');
} else {
$row['log_subject'] = purge_latin1($row['log_subject'], true);
$row['log_body_text'] = purge_latin1($row['log_body_text'], true);
$row['log_body_html'] = purge_latin1($row['log_body_html']);
}
}
$mailer->clear_all();
$mailer->set_from($listdata['sender_email'], unhtmlspecialchars($listdata['liste_name']));
$mailer->set_address($address);
$mailer->set_format($format);
$mailer->set_subject($row['log_subject']);
if ($listdata['return_email'] != '') {
$mailer->set_return_path($listdata['return_email']);
}
if ($format == FORMAT_TEXTE) {
$body = $row['log_body_text'];
} else {
$body = $row['log_body_html'];
}
//
// Ajout du lien de désinscription, selon le format utilisé
//
if ($listdata['use_cron']) {
示例4: array
/**
* launch_sending()
*
* Cette fonction est appellée soit dans envoi.php lors de l'envoi, soit
* dans le fichier appellé originellement cron.php
*
* @param array $listdata Tableau des données de la liste concernée
* @param array $logdata Tableau des données de la newsletter
* @param array $supp_address Adresses de destinataires supplémentaires
*
* @return string
*/
function launch_sending($listdata, $logdata, $supp_address = array())
{
global $nl_config, $db, $lang, $other_tags;
//
// On commence par poser un verrou sur un fichier lock,
// il ne faut pas qu'il y ait simultanément plusieurs flôts d'envois
// pour une même liste de diffusion.
//
$lockfile = sprintf(WA_LOCKFILE, $listdata['liste_id']);
if (file_exists($lockfile)) {
$isBeginning = false;
$fp = fopen($lockfile, 'r+');
$supp_address = array();
// On en tient pas compte, ça l'a déjà été lors du premier flôt
} else {
$isBeginning = true;
$fp = fopen($lockfile, 'w');
@chmod($lockfile, 0600);
}
if (!flock($fp, LOCK_EX | LOCK_NB)) {
fclose($fp);
return $lang['Message']['List_is_busy'];
}
if (filesize($lockfile) > 0) {
//
// L'envoi a planté au cours d'un "flôt" précédent. On récupère les éventuels
// identifiants d'abonnés stockés dans le fichier lock et on met à jour la table
//
$abo_ids = fread($fp, filesize($lockfile));
$abo_ids = array_map('trim', explode("\n", trim($abo_ids)));
if (count($abo_ids) > 0) {
$abo_ids = array_unique(array_map('intval', $abo_ids));
$sql = "UPDATE " . ABO_LISTE_TABLE . "\n\t\t\t\tSET send = 1\n\t\t\t\tWHERE abo_id IN(" . implode(', ', $abo_ids) . ")\n\t\t\t\t\tAND liste_id = " . $listdata['liste_id'];
if (!$db->query($sql)) {
trigger_error('Impossible de mettre à jour la table des abonnés', ERROR);
}
}
ftruncate($fp, 0);
fseek($fp, 0);
}
//
// Initialisation de la classe mailer
//
require WAMAILER_DIR . '/class.mailer.php';
$mailer = new Mailer(WA_ROOTDIR . '/language/email_' . $nl_config['language'] . '/');
if ($nl_config['use_smtp']) {
$mailer->smtp_path = WAMAILER_DIR . '/';
$mailer->use_smtp($nl_config['smtp_host'], $nl_config['smtp_port'], $nl_config['smtp_user'], $nl_config['smtp_pass']);
}
$mailer->set_charset($lang['CHARSET']);
$mailer->set_from($listdata['sender_email'], unhtmlspecialchars($listdata['liste_name']));
if ($listdata['return_email'] != '') {
$mailer->set_return_path($listdata['return_email']);
}
//
// On traite les données de la newsletter à envoyer
//
if (preg_match('/[\\x80-\\x9F]/', $logdata['log_subject']) || preg_match('/[\\x80-\\x9F]/', $logdata['log_body_text']) || preg_match('/[\\x80-\\x9F]/', $logdata['log_body_html'])) {
if (TRANSLITE_INVALID_CHARS == false) {
$logdata['log_subject'] = wan_utf8_encode($logdata['log_subject']);
$logdata['log_body_text'] = wan_utf8_encode($logdata['log_body_text']);
$logdata['log_body_html'] = wan_utf8_encode($logdata['log_body_html']);
$lang['Label_link'] = wan_utf8_encode($lang['Label_link']);
$mailer->set_charset('UTF-8');
} else {
$logdata['log_subject'] = purge_latin1($logdata['log_subject'], true);
$logdata['log_body_text'] = purge_latin1($logdata['log_body_text'], true);
$logdata['log_body_html'] = purge_latin1($logdata['log_body_html']);
}
}
$mailer->set_subject($logdata['log_subject']);
$body = array(FORMAT_TEXTE => $logdata['log_body_text'], FORMAT_HTML => $logdata['log_body_html']);
//
// Ajout du lien de désinscription, selon les méthodes d'envoi/format utilisés
//
$link = newsletter_links($listdata);
if ($listdata['use_cron'] || $nl_config['engine_send'] == ENGINE_BCC) {
$body[FORMAT_TEXTE] = str_replace('{LINKS}', $link[FORMAT_TEXTE], $body[FORMAT_TEXTE]);
$body[FORMAT_HTML] = str_replace('{LINKS}', $link[FORMAT_HTML], $body[FORMAT_HTML]);
}
//
// On s'occupe maintenant des fichiers joints ou incorporés
// Si les fichiers sont stockés sur un serveur ftp, on les rapatrie le temps du flot d'envoi
//
$total_files = count($logdata['joined_files']);
$tmp_files = array();
require WA_ROOTDIR . '/includes/class.attach.php';
$attach = new Attach();
//.........这里部分代码省略.........