本文整理汇总了PHP中smtp_mail函数的典型用法代码示例。如果您正苦于以下问题:PHP smtp_mail函数的具体用法?PHP smtp_mail怎么用?PHP smtp_mail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smtp_mail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_mail
function send_mail($to, $subject, $message, $from = '', $encoding = 'gbk')
{
global $mailcfg;
// Default sender/return address
if (!$from) {
$from = SYSTEM_NAME . '<' . $mailcfg['username'] . '>';
}
$type = $mailcfg['type'] == 'HTML' ? 'text/html' : 'text/plain';
// Do a little spring cleaning
$to = trim(preg_replace('#[\\n\\r]+#s', '', $to));
$subject = mb_convert_encoding(trim(preg_replace('#[\\n\\r]+#s', '', $subject)), 'gbk', 'utf-8');
$from = mb_convert_encoding(trim(preg_replace('#[\\n\\r:]+#s', '', $from)), 'gbk', 'utf-8');
$headers = 'From: ' . $from . "\r\n" . 'Date: ' . date('r') . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-transfer-encoding: 8bit' . "\r\n" . 'Content-type: ' . $type . '; charset=' . $encoding . "\r\n" . 'X-Mailer: Ecosme-Mailer';
// Make sure all linebreaks are CRLF in message (and strip out any NULL bytes)
$message = str_replace(array("\n", ""), array("\r\n", ''), linebreaks($message));
$message = mb_convert_encoding($message, 'gbk', 'utf-8');
if ($mailcfg['server'] != '') {
smtp_mail($to, $subject, $message, $headers);
} else {
// Change the linebreaks used in the headers according to OS
if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') {
$headers = str_replace("\r\n", "\r", $headers);
} else {
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
$headers = str_replace("\r\n", "\n", $headers);
}
}
mail($to, $subject, $message, $headers);
}
}
示例2: pun_mail
function pun_mail($to, $subject, $message, $from = '')
{
global $pun_config, $lang_common;
$sender = str_replace('"', '', $pun_config['o_board_title'] . ' ' . $lang_common['Mailer']);
// Default sender/return address
if (!$from) {
$from = '"=?UTF-8?B?' . base64_encode($sender) . '?=" <' . $pun_config['o_webmaster_email'] . '>';
}
// Do a little spring cleaning
$to = trim(preg_replace('#[\\n\\r]+#s', '', $to));
$subject = trim(preg_replace('#[\\n\\r]+#s', '', $subject));
$from = trim(preg_replace('#[\\n\\r:]+#s', '', $from));
$subject = '=?UTF-8?B?' . base64_encode($subject) . '?=';
$headers = 'From: ' . $from . "\r\n" . 'Date: ' . date('r') . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-transfer-encoding: 8bit' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n" . 'X-Mailer: PunBB Mailer';
// Make sure all linebreaks are CRLF in message (and strip out any NULL bytes)
$message = str_replace(array("\n", ""), array("\r\n", ''), pun_linebreaks($message));
if ($pun_config['o_smtp_host']) {
return smtp_mail($to, $subject, $message, $headers);
} else {
// Change the linebreaks used in the headers according to OS
if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') {
$headers = str_replace("\r\n", "\r", $headers);
} else {
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
$headers = str_replace("\r\n", "\n", $headers);
}
}
return mail($to, $subject, $message, $headers);
}
}
示例3: pun_mail
function pun_mail($to, $subject, $message, $from = '')
{
global $pun_config, $lang_common;
// Default sender/return address
if (!$from) {
$from = '"' . str_replace('"', '', $pun_config['o_board_title'] . ' ' . $lang_common['Mailer']) . '" <' . $pun_config['o_webmaster_email'] . '>';
}
// Do a little spring cleaning
$to = trim(preg_replace('#[\\n\\r]+#s', '', $to));
$subject = trim(preg_replace('#[\\n\\r]+#s', '', $subject));
$from = trim(preg_replace('#[\\n\\r:]+#s', '', $from));
// Detect what linebreak we should use for the headers
if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) {
$eol = "\r\n";
} else {
if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) {
$eol = "\r";
} else {
$eol = "\n";
}
}
$headers = 'From: ' . $from . $eol . 'Date: ' . date('r') . $eol . 'MIME-Version: 1.0' . $eol . 'Content-transfer-encoding: 8bit' . $eol . 'Content-type: text/plain; charset=' . $lang_common['lang_encoding'] . $eol . 'X-Mailer: PunBB Mailer';
// Make sure all linebreaks are CRLF in message
$message = str_replace("\n", "\r\n", pun_linebreaks($message));
if ($pun_config['o_smtp_host'] != '') {
smtp_mail($to, $subject, $message, $headers);
} else {
mail($to, $subject, $message, $headers);
}
}
示例4: cpg_mail
function cpg_mail($to, $subject, $msg_body, $type = 'text/plain', $sender_name = '', $sender_email = '')
{
global $CONFIG;
global $lang_charset;
if ($sender_name == '') {
$sender_name = $CONFIG['gallery_name'];
}
if ($sender_email == '') {
$sender_email = $CONFIG['gallery_admin_email'];
}
$charset = $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'];
$extra_headers = "From: {$sender_name} <{$sender_email}>\n" . "MIME-Version: 1.0\n" . "Content-type: {$type}; charset=" . $charset . "\n" . "Content-transfer-encoding: 8bit\n" . "Date: " . gmdate('D, d M Y H:i:s', time()) . " UT\n" . "X-Priority: 3 (Normal)\n" . "X-MSMail-Priority: Normal\n" . "X-Mailer: Coppermine Photo Gallery\n" . "Importance: Normal";
// Fix any bare linefeeds in the message to make it RFC821 Compliant.
$message = preg_replace("/(?<!\r)\n/si", "\r\n", $msg_body);
if (empty($CONFIG['smtp_host'])) {
return mail($to, $subject, $msg_body, $extra_headers);
} else {
return smtp_mail($to, $subject, $msg_body, $extra_headers);
}
}
示例5: forum_mail
function forum_mail($to, $subject, $message, $reply_to_email = '', $reply_to_name = '')
{
global $forum_config, $lang_common;
// Default sender address
$from_name = sprintf($lang_common['Forum mailer'], $forum_config['o_board_title']);
$from_email = $forum_config['o_webmaster_email'];
($hook = get_hook('em_fn_forum_mail_start')) ? eval($hook) : null;
// Do a little spring cleaning
$to = forum_trim(preg_replace('#[\\n\\r]+#s', '', $to));
$subject = forum_trim(preg_replace('#[\\n\\r]+#s', '', $subject));
$from_email = forum_trim(preg_replace('#[\\n\\r:]+#s', '', $from_email));
$from_name = forum_trim(preg_replace('#[\\n\\r:]+#s', '', str_replace('"', '', $from_name)));
$reply_to_email = forum_trim(preg_replace('#[\\n\\r:]+#s', '', $reply_to_email));
$reply_to_name = forum_trim(preg_replace('#[\\n\\r:]+#s', '', str_replace('"', '', $reply_to_name)));
// Set up some headers to take advantage of UTF-8
$from = "=?UTF-8?B?" . base64_encode($from_name) . "?=" . ' <' . $from_email . '>';
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
$headers = 'From: ' . $from . "\r\n" . 'Date: ' . gmdate('r') . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-transfer-encoding: 8bit' . "\r\n" . 'Content-type: text/plain; charset=utf-8' . "\r\n" . 'X-Mailer: PunBB Mailer';
// If we specified a reply-to email, we deal with it here
if (!empty($reply_to_email)) {
$reply_to = "=?UTF-8?B?" . base64_encode($reply_to_name) . "?=" . ' <' . $reply_to_email . '>';
$headers .= "\r\n" . 'Reply-To: ' . $reply_to;
}
// Make sure all linebreaks are CRLF in message (and strip out any NULL bytes)
$message = str_replace(array("\n", ""), array("\r\n", ''), forum_linebreaks($message));
($hook = get_hook('em_fn_forum_mail_pre_send')) ? eval($hook) : null;
if ($forum_config['o_smtp_host'] != '') {
smtp_mail($to, $subject, $message, $headers);
} else {
// Change the linebreaks used in the headers according to OS
if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') {
$headers = str_replace("\r\n", "\r", $headers);
} else {
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
$headers = str_replace("\r\n", "\n", $headers);
}
}
mail($to, $subject, $message, $headers);
}
}
示例6: pun_mail
function pun_mail($to, $subject, $message, $from = '')
{
global $pun_config, $lang_common;
// Default sender/return address
if (!$from) {
$from = '"' . str_replace('"', '', $pun_config['o_board_title'] . ' ' . $lang_common['Mailer']) . '" <' . $pun_config['o_webmaster_email'] . '>';
}
// Do a little spring cleaning
$to = trim(preg_replace('#[\\n\\r]+#s', '', $to));
$subject = trim(preg_replace('#[\\n\\r]+#s', '', $subject));
$from = trim(preg_replace('#[\\n\\r:]+#s', '', $from));
$headers = 'From: ' . $from . "\r\n" . 'Date: ' . date('r') . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-transfer-encoding: ' . $lang_common['mail_transfer_encoding'] . "\r\n" . 'Content-type: text/plain; charset=' . $lang_common['mail_encoding'] . "\r\n" . 'X-Mailer: PunBB Mailer';
// 'mail_encoding' => 'UTF-8',
// 'mail_transfer_encoding' => '7bit',
// Make sure all linebreaks are CRLF in message (and strip out any NULL bytes)
$message = str_replace(array("\n", ""), array("\r\n", ''), pun_linebreaks($message));
//$message = str_replace("\n", "\r\n", pun_linebreaks($message)); // old
if ($pun_config['o_smtp_host'] != '') {
smtp_mail($to, $subject, $message, $headers);
} else {
// Change the linebreaks used in the headers according to OS
if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') {
$headers = str_replace("\r\n", "\r", $headers);
} else {
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
$headers = str_replace("\r\n", "\n", $headers);
}
}
//adding 5th parmeter to email function for correct returnpath
if (ini_get('safe_mode')) {
// Do it the safe mode way
mail($to, $subject, $message, $headers);
} else {
// Do it the regular way
mail($to, $subject, $message, $headers, "-r" . $pun_config['o_webmaster_email']);
}
}
}
示例7: smtp_mail
// send as HTML
// 邮件主题
$mail->Subject = $subject;
// 邮件内容
$mail->Body = '<html><head>' . '<meta http-equiv="Content-Language" content="zh-cn">' . '<meta http-equiv="Content-Type" content="text/html; charset=GB2312"> ' . '</head>' . '<body>' . 'I love php' . '</body>' . '</html>';
$mail->AltBody = "text/html";
if (!$mail->Send()) {
echo "邮件发送有误 <p>";
echo "邮件错误信息: " . $mail->ErrorInfo;
exit;
} else {
echo "{$user_name} 邮件发送成功!<br />";
}
}
// 参数说明(发送到, 邮件主题, 邮件内容, 附加信息, 用户名)
smtp_mail("1832427179@qq.com", "欢迎使用phpmailer!", null, "yourdomain.com", "夏了夏天");
//SMTP needs accurate times, and the PHP time zone MUST be set
//This should be done in your php.ini, but this is how to do it if you don't have access to that
//date_default_timezone_set('Etc/UTC');
//
////require '../PHPMailerAutoload.php';
//
////Create a new PHPMailer instance
//$mail = new PHPMailer();
//$mail->CharSet = 'utf-8';
////Tell PHPMailer to use SMTP
//$mail->isSMTP();
////Enable SMTP debugging
//// 0 = off (for production use)
//// 1 = client messages
//// 2 = client and server messages
示例8: foreach
$message .= "Name: " . $creid[0]['Task_Name'] . "\r\n<br />";
$message .= $r['Task_Description'] . "\r\n<br />";
$tsk = $slave->select("SELECT * FROM Task_Logs WHERE Task_ID=" . $data['Task_ID']);
if ($tsk) {
foreach ($tsk as $t) {
$message .= $t['Public_Note'] . "\r\n<br />";
}
}
if (valid_email($requester[0]['Email'])) {
$ftemail = $requester[0]['Email'];
} else {
$ftemail = $noreply_email;
}
//print_r($r);
//print_r($requester);
smtp_mail("", "", $r['Email'], $ftemail, display_name($requester[0]['First_Name'], $requester[0]['Last_Name']), $ftemail, $subject, $message);
}
}
}
}
} elseif ($_POST['acknowledge']) {
foreach ($_POST['acknowledge'] as $tid => $ack) {
$data['User_ID'] = $_SESSION['user_id'];
$data['Acknowledged'] = date("Y-m-d H:i:s");
$data['Accepted'] = '1';
$data['Task_ID'] = $tid;
$data['Progress'] = $_POST['progress'][$tid];
$insert = $db->insert("Task_Acknowledgement", $data);
}
} elseif ($_POST['task_id']) {
$data['User_ID'] = $_SESSION['user_id'];
示例9: pun_mail
function pun_mail($to, $subject, $message, $reply_to_email = '', $reply_to_name = '')
{
global $pun_config, $lang;
// Default sender/return address
$from_name = $lang->t('Mailer', $pun_config['o_board_title']);
$from_email = $pun_config['o_webmaster_email'];
// Do a little spring cleaning
$to = pun_trim(preg_replace('%[\\n\\r]+%s', '', $to));
$subject = pun_trim(preg_replace('%[\\n\\r]+%s', '', $subject));
$from_email = pun_trim(preg_replace('%[\\n\\r:]+%s', '', $from_email));
$from_name = pun_trim(preg_replace('%[\\n\\r:]+%s', '', str_replace('"', '', $from_name)));
$reply_to_email = pun_trim(preg_replace('%[\\n\\r:]+%s', '', $reply_to_email));
$reply_to_name = pun_trim(preg_replace('%[\\n\\r:]+%s', '', str_replace('"', '', $reply_to_name)));
// Set up some headers to take advantage of UTF-8
$from = '"' . encode_mail_text($from_name) . '" <' . $from_email . '>';
$subject = encode_mail_text($subject);
$headers = 'From: ' . $from . "\r\n" . 'Date: ' . gmdate('r') . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-transfer-encoding: 8bit' . "\r\n" . 'Content-type: text/plain; charset=utf-8' . "\r\n" . 'X-Mailer: FluxBB Mailer';
// If we specified a reply-to email, we deal with it here
if (!empty($reply_to_email)) {
$reply_to = '"' . encode_mail_text($reply_to_name) . '" <' . $reply_to_email . '>';
$headers .= "\r\n" . 'Reply-To: ' . $reply_to;
}
// Make sure all linebreaks are LF in message (and strip out any NULL bytes)
$message = str_replace("", '', pun_linebreaks($message));
if ($pun_config['o_smtp_host'] != '') {
// Headers should be \r\n
// Message should be ??
$message = str_replace("\n", "\r\n", $message);
smtp_mail($to, $subject, $message, $headers);
} else {
// Headers should be \r\n
// Message should be \n
mail($to, $subject, $message, $headers);
}
}
示例10: ReduceMailQueue
function ReduceMailQueue($number = false, $override_limit = false, $force_send = false)
{
global $modSettings, $smcFunc, $sourcedir;
// Are we intending another script to be sending out the queue?
if (!empty($modSettings['mail_queue_use_cron']) && empty($force_send)) {
return false;
}
// By default send 5 at once.
if (!$number) {
$number = empty($modSettings['mail_quantity']) ? 5 : $modSettings['mail_quantity'];
}
// If we came with a timestamp, and that doesn't match the next event, then someone else has beaten us.
if (isset($_GET['ts']) && $_GET['ts'] != $modSettings['mail_next_send'] && empty($force_send)) {
return false;
}
// By default move the next sending on by 10 seconds, and require an affected row.
if (!$override_limit) {
$delay = !empty($modSettings['mail_queue_delay']) ? $modSettings['mail_queue_delay'] : (!empty($modSettings['mail_limit']) && $modSettings['mail_limit'] < 5 ? 10 : 5);
smf_db_query('
UPDATE {db_prefix}settings
SET value = {string:next_mail_send}
WHERE variable = {string:mail_next_send}
AND value = {string:last_send}', array('next_mail_send' => time() + $delay, 'mail_next_send' => 'mail_next_send', 'last_send' => $modSettings['mail_next_send']));
if (smf_db_affected_rows() == 0) {
return false;
}
$modSettings['mail_next_send'] = time() + $delay;
}
// If we're not overriding how many are we allow to send?
if (!$override_limit && !empty($modSettings['mail_limit'])) {
list($mt, $mn) = @explode('|', $modSettings['mail_recent']);
// Nothing worth noting...
if (empty($mn) || $mt < time() - 60) {
$mt = time();
$mn = $number;
} elseif ($mn < $modSettings['mail_limit']) {
$mn += $number;
} else {
return false;
}
// Reflect that we're about to send some, do it now to be safe.
updateSettings(array('mail_recent' => $mt . '|' . $mn));
}
// Now we know how many we're sending, let's send them.
$request = smf_db_query('
SELECT /*!40001 SQL_NO_CACHE */ id_mail, recipient, body, subject, headers, send_html
FROM {db_prefix}mail_queue
ORDER BY priority ASC, id_mail ASC
LIMIT ' . $number, array());
$ids = array();
$emails = array();
while ($row = mysql_fetch_assoc($request)) {
// We want to delete these from the database ASAP, so just get the data and go.
$ids[] = $row['id_mail'];
$emails[] = array('to' => $row['recipient'], 'body' => $row['body'], 'subject' => $row['subject'], 'headers' => $row['headers'], 'send_html' => $row['send_html']);
}
mysql_free_result($request);
// Delete, delete, delete!!!
if (!empty($ids)) {
smf_db_query('
DELETE FROM {db_prefix}mail_queue
WHERE id_mail IN ({array_int:mail_list})', array('mail_list' => $ids));
}
// Don't believe we have any left?
if (count($ids) < $number) {
// Only update the setting if no-one else has beaten us to it.
smf_db_query('
UPDATE {db_prefix}settings
SET value = {string:no_send}
WHERE variable = {string:mail_next_send}
AND value = {string:last_mail_send}', array('no_send' => '0', 'mail_next_send' => 'mail_next_send', 'last_mail_send' => $modSettings['mail_next_send']));
}
if (empty($ids)) {
return false;
}
if (!empty($modSettings['mail_type']) && $modSettings['smtp_host'] != '') {
require_once $sourcedir . '/lib/Subs-Post.php';
}
// Send each email, yea!
$failed_emails = array();
foreach ($emails as $key => $email) {
if (empty($modSettings['mail_type']) || $modSettings['smtp_host'] == '') {
$email['subject'] = strtr($email['subject'], array("\r" => '', "\n" => ''));
if (!empty($modSettings['mail_strip_carriage'])) {
$email['body'] = strtr($email['body'], array("\r" => ''));
$email['headers'] = strtr($email['headers'], array("\r" => ''));
}
// No point logging a specific error here, as we have no language. PHP error is helpful anyway...
$result = mail(strtr($email['to'], array("\r" => '', "\n" => '')), $email['subject'], $email['body'], $email['headers']);
// Try to stop a timeout, this would be bad...
@set_time_limit(300);
if (function_exists('apache_reset_timeout')) {
@apache_reset_timeout();
}
} else {
$result = smtp_mail(array($email['to']), $email['subject'], $email['body'], $email['send_html'] ? $email['headers'] : 'Mime-Version: 1.0' . "\r\n" . $email['headers']);
}
// Hopefully it sent?
if (!$result) {
$failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html']);
//.........这里部分代码省略.........
示例11: exit
if ($act == "send_code") {
if (empty($email) || !preg_match("/^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]w+)*\$/", $email)) {
exit("邮箱格式错误");
}
$sql = "select * from " . table('members') . " where email = '{$email}' LIMIT 1";
$userinfo = $db->getone($sql);
if ($userinfo && $userinfo['uid'] != $_SESSION['uid']) {
exit("邮箱已经存在!请填写其他邮箱");
} elseif (!empty($userinfo['email']) && $userinfo['email_audit'] == "1" && $userinfo['email'] == $email) {
exit("你的邮箱 {$email} 已经通过验证!");
} else {
if ($_SESSION['sendemail_time'] && time() - $_SESSION['sendemail_time'] < 10) {
exit("请60秒后再进行验证!");
}
$rand = mt_rand(100000, 999999);
if (smtp_mail($email, "{$_CFG['site_name']}邮件认证", "{$QISHI['site_name']}提醒您:<br>您正在进行邮箱验证,验证码为:<strong>{$rand}</strong>")) {
$_SESSION['verify_email'] = $email;
$_SESSION['email_rand'] = $rand;
$_SESSION['sendemail_time'] = time();
exit("success");
} else {
exit("邮箱配置出错,请联系网站管理员");
}
}
} elseif ($act == "verify_code") {
$verifycode = trim($_POST['verifycode']);
if (empty($verifycode) || empty($_SESSION['email_rand']) || $verifycode != $_SESSION['email_rand']) {
exit("验证码错误");
} else {
$uid = intval($_SESSION['uid']);
if (empty($uid)) {
示例12: while
// 发件人邮箱
$mail->FromName = "PHPMailer";
// 发件人
$mail->CharSet = "utf-8";
// 这里指定字符集!
$mail->Encoding = "base64";
$mail->AddAddress($sendto_email, "王庭蛟");
// 收件人邮箱和姓名
$mail->AddReplyTo("327455748@qq.com", "yourdomain.com");
//$mail->WordWrap = 50; // set word wrap 换行字数
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment 附件
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true);
// send as HTML
// 邮件主题
$mail->Subject = $subject;
// 邮件内容
$mail->Body = "hello, this is an e-mail";
$mail->AltBody = "text/html";
if (!$mail->Send()) {
echo "邮件发送有误 <p>";
echo "邮件错误信息: " . $mail->ErrorInfo;
exit;
} else {
echo "{$user_name} 邮件发送成功!<br />";
}
}
// 参数说明(发送到, 邮件主题, 邮件内容, 附加信息, 用户名)
while ($i++ < 10) {
smtp_mail("327455748@qq.com", "欢迎使用phpmailer!", "NULL", "yourdomain.com", "327455748");
}
示例13: smtp_mail
$htm .= '<div>
没有填写工作经历
</div>';
}
$htm .= '</div>';
if ($resume_basic["specialty"]) {
$htm .= '<div style="padding-bottom: 10px;">
<p style="font-size: 16px;font-weight: 700;">自我描述</p>
<p>' . $resume_basic["specialty"] . '</p>
</div>';
}
$htm .= '<div style="text-align: center;margin-top:20px">
该简历来自<a href="' . $_CFG["site_domain"] . $_CFG["site_dir"] . '">' . $_CFG["site_name"] . '</a>
</div>
</div>';
$rst = smtp_mail($_GET['email'], "{$resume_basic['fullname']}的简历", $htm);
exit($rst);
} elseif ($act == "auto_refresh") {
global $db;
$id = $_GET['id'] ? intval($_GET['id']) : exit('ID丢失!');
$user_points = get_user_points($_SESSION['uid']);
$row = $db->getone("select * from " . table("jobs") . " where id={$id} and uid={$_SESSION['uid']} limit 1 ");
/* 预约刷新 */
if ($row['auto_refresh'] == 1) {
$auto_refresh = $db->getone('select appointment_time,appointment_time_available,points,execute_time from ' . table("jobs_appointment_refresh") . " where jobs_id={$row['id']} limit 1");
$row['auto_refresh_num_all'] = $auto_refresh['appointment_time'];
$row['auto_refresh_num'] = $auto_refresh['appointment_time_available'];
$row['points'] = $auto_refresh['points'];
$row['points_day'] = $auto_refresh['points'] /= $auto_refresh['appointment_time'];
$taday = date('Y-m-d');
$is_taday = date("Y-m-d", $auto_refresh['execute_time']);
示例14: send_email
public function send_email($re_user_id, $re_user_email, $token, $active)
{
if ($re_user_id) {
$re_user_id = md5($re_user_id);
$subject = "使命青年团契确认函:请完成您的绑定";
$user_name = $re_user_email;
$msg = smtp_mail($re_user_email, $subject, "null", $re_user_id, $token, $user_name, $active);
$this->response(array('status_code' => 200, 'message' => $msg, 'results' => $re_user_id));
return;
} else {
$this->response(array('status_code' => 403, 'message' => '申请失败!请重试!'));
return;
}
}
示例15: mb_internal_encoding
if ($result['rows'] > 0) {
mb_internal_encoding("UTF-8");
$b_name = mb_encode_mimeheader($_POST['name'], 'UTF-8', 'Q');
$b_subject = mb_encode_mimeheader($_POST['subject'], 'UTF-8', 'Q');
$b_message = base64_encode($_POST['message']);
$i = 0;
while ($row = db_array($result['result'])) {
$fTo = $row[0];
$fHeaders = 'To: ' . $fTo . "\n";
$fHeaders .= 'From: ' . $b_name . ' <' . $smtp_from_email . ">\n";
$fHeaders .= 'Subject: ' . $b_subject . "\n";
$fHeaders .= 'MIME-Version: 1.0' . "\n";
$fHeaders .= 'Content-Type: text/plain; charset=UTF-8' . "\n";
$fHeaders .= 'Content-Transfer-Encoding: base64' . "\n";
$fHeaders .= $b_message;
if (!smtp_mail($fTo, $smtp_from_email, $fHeaders)) {
flash_error(Config::lang_f('pSendmail_result_error', $fTo));
} else {
flash_info(Config::lang_f('pSendmail_result_success', $fTo));
}
}
}
flash_info($PALANG['pBroadcast_success']);
$smarty->assign('smarty_template', 'message');
$smarty->display('index.tpl');
// echo '<p>'.$PALANG['pBroadcast_success'].'</p>';
}
}
if ($_SERVER['REQUEST_METHOD'] == "GET" || $error == 1) {
$smarty->assign('smtp_from_email', $smtp_from_email);
$smarty->assign('error', $error);