本文整理汇总了PHP中mail::sendMail方法的典型用法代码示例。如果您正苦于以下问题:PHP mail::sendMail方法的具体用法?PHP mail::sendMail怎么用?PHP mail::sendMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mail
的用法示例。
在下文中一共展示了mail::sendMail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
$message = __('Someone has requested to reset the password for the following site and username.') . "\n\n" . $page_url . "\n" . __('Username:') . ' ' . $user_id . "\n\n" . __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\n" . $page_url . '?akey=' . $recover_key;
$headers[] = 'From: ' . (defined('DC_ADMIN_MAILFROM') && DC_ADMIN_MAILFROM ? DC_ADMIN_MAILFROM : 'dotclear@local');
$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
mail::sendMail($user_email, $subject, $message, $headers);
$msg = sprintf(__('The e-mail was sent successfully to %s.'), $user_email);
} catch (Exception $e) {
$err = $e->getMessage();
}
} elseif ($akey) {
try {
$recover_res = $core->auth->recoverUserPassword($akey);
$subject = mb_encode_mimeheader('DotClear ' . __('Your new password'), 'UTF-8', 'B');
$message = __('Username:') . ' ' . $recover_res['user_id'] . "\n" . __('Password:') . ' ' . $recover_res['new_pass'] . "\n\n" . preg_replace('/\\?(.*)$/', '', $page_url);
$headers[] = 'From: dotclear@' . $_SERVER['HTTP_HOST'];
$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
mail::sendMail($recover_res['user_email'], $subject, $message, $headers);
$msg = __('Your new password is in your mailbox.');
} catch (Exception $e) {
$err = $e->getMessage();
}
} elseif ($change_pwd) {
try {
$tmp_data = explode('/', $_POST['login_data']);
if (count($tmp_data) != 3) {
throw new Exception();
}
$data = array('user_id' => base64_decode($tmp_data[0]), 'cookie_admin' => $tmp_data[1], 'user_remember' => $tmp_data[2] == '1');
if ($data['user_id'] === false) {
throw new Exception();
}
# Check login informations
示例2: addPaymentReport
public function addPaymentReport($payment_details, $mineral_details)
{
//first we do query to enter report headers
$_user = $_SESSION["user"];
//get user and company info
$entityType = "";
$govtid = 'null';
$TPIN = 'null';
//check if user is from mine or government
if ($_user->TPIN != null) {
$entityType = 'mine';
$TPIN = $_user->TPIN;
} else {
$entityType = 'gov';
$govtid = $_user->entityID;
}
//get date or period
$period = date("Y");
$dateSub = date("Y-m-d");
//get for which mine
$forWhichMine = isset($_SESSION["forWhichMine"]) ? $_SESSION["forWhichMine"] : 'null';
//get userid
$userID = $_user->userID;
if (!isset($_SESSION["reportID"])) {
$sql1 = "INSERT INTO report(period,govtEntityID,userID,TPIN,templateID, dateSubmitted, forWhichMine) VALUES('{$period}',{$govtid},{$userID},{$TPIN},2, '{$dateSub}', {$forWhichMine})";
mysqli_query($this->con, $sql1);
var_dump(mysqli_error($this->con), $sql1);
}
//get reportid
$reportID = isset($_SESSION["reportID"]) ? $_SESSION["reportID"] : mysqli_insert_id($this->con);
if ($reportID == 0) {
exit("Error!");
}
//$reportID = 1;
//need to create an insert statement with a for loop
$sql = "INSERT INTO paymentdetails(reportID,refNumber,paid_received_zmw,paid_received_usd,comments) VALUES";
foreach ($payment_details as $value) {
$sql .= "({$reportID},{$value->refNumber},{$value->paid_receivedZMW},{$value->paid_receivedUSD}, '{$value->comments}'),";
}
$sql = chop($sql, ",");
$sql .= "ON DUPLICATE KEY UPDATE paid_received_zmw = VALUES(paid_received_zmw), paid_received_usd = VALUES(paid_received_usd),comments = VALUES(comments)";
//
mysqli_query($this->con, $sql);
//var_dump(mysqli_error($this->con), $sql);
//create sql for mineral details
//need to create an insert statement with a for loop
$sql = "INSERT INTO mineraldetails(reportID,refNumber,copperTonnes,copperValue_usd,cobaltTonnes,cobaltValue_usd,goldKg_usd,goldValue_usd,coalTonnes,coalValue_usd ) VALUES";
foreach ($mineral_details as $value) {
$sql .= "({$reportID},{$value->refNumber},{$value->copperTonnes},{$value->copperValue}, {$value->cobaltTonnes}, {$value->cobaltValue}, {$value->goldkg}, {$value->goldValue},{$value->coalTonnes}, {$value->coalValue}),";
}
$sql = chop($sql, ",");
$sql .= "ON DUPLICATE KEY UPDATE copperTonnes = VALUES(copperTonnes),copperValue_usd = VALUES(copperValue_usd),cobaltTonnes = VALUES(cobaltTonnes),cobaltValue_usd = VALUES(cobaltValue_usd),goldKg_usd = VALUES(goldKg_usd), goldValue_usd = VALUES(goldValue_usd), coalTonnes = VALUES(coalTonnes), coalValue_usd = VALUES(coalValue_usd)";
mysqli_query($this->con, $sql);
//var_dump(mysqli_error($this->con), $sql);
//email sending...must look for standard user
$sql_gmu = "";
if ($entityType = 'mine') {
$sql_gmu = "select emailAddress from user where TPIN = {$TPIN} and role = 'mu'";
} else {
$sql_gmu = "select emailAddress from user where entityID = {$govtid} and role = 'mu'";
}
$result = mysqli_query($this->con, $sql_gmu);
$row = mysqli_fetch_row($result);
$subject = "ZEII submission";
$message = "Please follow this link www.zambiaeiti.org/ZeitiPortal/entities/viewFacade.php?action=report&id={$reportID}&tid=2&p={$period}";
mail::sendMail($row[0], $subject, $message);
}
示例3: sendSingleMail
function sendSingleMail(MailStack $mail)
{
mail::sendMail($mail->address, $mail->theme, $mail->message);
return $this->setSendedStatus($mail->id);
}