本文整理汇总了PHP中Mail::SendMail方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::SendMail方法的具体用法?PHP Mail::SendMail怎么用?PHP Mail::SendMail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::SendMail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSendEmail
public function doSendEmail()
{
$mail = new Mail();
$data = array();
$data[] = "Получена новая информация с формы обратной связи [" . date("Y-m-d H:i") . "]";
$data[] = "Имя: {$this->getName()}";
$data[] = "Email: {$this->getEmail()}";
if ($this->getPhone()) {
$data[] = "Телефон: {$this->getPhone()}";
}
$data[] = "Сообщение: {$this->getMessage()}";
$data = implode("<br />", $data);
$emails = (array) fvSite::$fvConfig->get("email.feedback");
foreach ($emails as $m) {
$mail->SendMail($m, "Форма обратной связи", $data);
}
}
示例2: ConfirmDonation
function ConfirmDonation(&$db, $idx)
{
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Donations.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Donations.php";
$db->Query("SELECT * FROM Z_Income WHERE idx = '{$idx}'");
$data = $db->GetRow();
require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Account.class.php";
$acc = new Account($db);
$Amount = $data['amount'];
if (isset($DonationsPercentDeposit) && $DonationsPercentDeposit != 100) {
$Amount = (int) ($Amount * $DonationsPercentDeposit / 100);
}
$acc->AddCredits($data['memb___id'], 0, $Amount, $db);
$db->Query("UPDATE Z_Income SET status = '1' , date_confirm = getdate() WHERE idx = '{$idx}'");
$dateClass = new Date();
$currentDateTime = $dateClass->DateFormat(date("Y-m-d")) . " " . $dateClass->TimeFormat(date("H:i"), "h");
$replaces = array("[number]" => $idx, "[amount]" => $Amount, "[date]" => $currentDateTime);
foreach ($replaces as $Key => $Value) {
$DonationsMessage29 = str_replace($Key, $Value, $DonationsMessage29);
$DonationsMessage33 = str_replace($Key, $Value, $DonationsMessage33);
$DonationsMessage34 = str_replace($Key, $Value, $DonationsMessage34);
}
if ($DonationsMessage) {
$acc->NewUserMessage($db, $data['memb___id'], $DonationsMessage29, $DonationsMessage34);
}
if ($DonationsMail) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Mail.class.php";
$db->Query("SELECT mail_addr,memb_name FROM MEMB_INFO WHERE memb___id = '" . $data['memb___id'] . "'");
$userData = $db->GetRow();
$mailCass = new Mail();
$mailCass->SendMail($userData['mail_addr'], $userData['memb_name'], $DonationsMessage29, $DonationsMessage33);
}
return $DonationsMessage35;
}
示例3: SendMessage
function SendMessage($post, &$db)
{
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Users.php";
if ($post['type'] == "1" || $post['type'] == "3") {
require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Account.class.php";
$this->acc = new Account($db);
$this->acc->NewUserMessage($db, $post['memb___id'], $post['title'], $post['text']);
}
if ($post['type'] == "2" || $post['type'] == "3") {
require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Mail.class.php";
$db->Query("SELECT mail_addr, memb_name FROM MEMB_INFO WHERE memb___id = '" . $post['memb___id'] . "'");
$mail = $db->GetRow();
$name = $mail[1];
$mail = $mail[0];
$mailCass = new Mail();
$mailCass->SendMail($mail, $name, $post['title'], $post['text']);
}
return $UsersMessage056;
}
示例4: AddMessage
function AddMessage(&$db, $post)
{
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/HelpDesk.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/HelpDesk.php";
$dateClass = new Date();
foreach ($post as $Key => $Value) {
${$Key} = $Value;
}
$db->Query("UPDATE Z_HelpDeskTickets SET status = '{$TicketStatus}', admin = '{$Admin}', last_update = getdate() WHERE idx = '{$ticketId}'");
if (strlen($HelpDeskMessageBox) > 0) {
$HelpDeskMessageBox = stripslashes(nl2br(htmlspecialchars($HelpDeskMessageBox)));
$db->Query("INSERT INTO Z_HelpDeskMessages (ticket_idx,message,[by]) VALUES ('{$ticketId}','{$HelpDeskMessageBox}','" . $_SESSION['ManagerName'] . "')");
$currentDateTime = $dateClass->DateFormat(date("Y-m-d")) . " " . $dateClass->TimeFormat(date("H:i"), "h");
$statusName = $this->TicketStatus($TicketStatus);
$replaces = array("[number]" => $ticketId, "[status]" => $statusName, "[admin]" => $_SESSION['ManagerName'], "[date]" => $currentDateTime);
foreach ($replaces as $Key => $Value) {
$HelpDeskMessage025 = str_replace($Key, $Value, $HelpDeskMessage025);
$HelpDeskMessage026 = str_replace($Key, $Value, $HelpDeskMessage026);
$HelpDeskMessage028 = str_replace($Key, $Value, $HelpDeskMessage028);
}
if ($HelpDeskMessage) {
$this->acc->NewUserMessage($db, $memb___id, $HelpDeskMessage025, $HelpDeskMessage026);
}
if ($HelpDeskMail) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Mail.class.php";
$db->Query("SELECT mail_addr, memb_name FROM MEMB_INFO WHERE memb___id = '{$memb___id}'");
$mail = $db->GetRow();
$name = $mail[1];
$mail = $mail[0];
$mailCass = new Mail();
$mailCass->SendMail($mail, $name, $HelpDeskMessage025, $HelpDeskMessage028);
}
}
return;
}
示例5: LostPassword
function LostPassword($post)
{
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/SQL.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Users.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Language/{$MainLanguage}/LostPassword.php";
$db = $this->db;
if (!isset($UsersForceLower) || $UsersForceLower) {
$memb___id = strtolower($post['memb___id']);
} else {
$memb___id = $post['memb___id'];
}
$db->Query("SELECT COUNT(idx) FROM Z_LostPasswordLog WHERE memb___id = '{$memb___id}' AND (DATEDIFF(mi,date,getdate()) < 30)");
$log = $db->GetRow();
if ($log[0] > 0) {
return $LostPasswordMessage06;
}
if (isset($post['mail_addr'])) {
$mail_addr = $post['mail_addr'];
$db->Query("SELECT memb__pwd, mail_addr,sno__numb,fpas_ques,fpas_answ FROM MEMB_INFO WHERE memb___id = '{$memb___id}' AND mail_addr = '{$mail_addr}'");
}
if (isset($post['sno__numb'])) {
$sno__numb = $post['sno__numb'];
$db->Query("SELECT memb__pwd, mail_addr,sno__numb,fpas_ques,fpas_answ FROM MEMB_INFO WHERE memb___id = '{$memb___id}' AND sno__numb = '000000{$sno__numb}'");
}
if ($db->NumRows() > 0) {
$data = $db->GetRow();
if ($SQLMD5Password) {
$new___pwd = rand(10000, 99999);
$db->Query("UPDATE MEMB_INFO SET memb__pwd = [{$SQLDBName}].[dbo].[DT_GenHash]('{$memb___id}','{$new___pwd}')\tWHERE memb___id = '{$memb___id}'");
$memb__pwd = $new___pwd;
} else {
$memb__pwd = $data[0];
}
$mail_addr = $data[1];
} else {
return $LostPasswordMessage01 . " ({$memb___id} - {$mail_addr})";
}
$replaces = array("[mail_addr]" => $mail_addr, "[memb___id]" => $memb___id, "[memb__pwd]" => $memb__pwd, "[sno__numb]" => substr($data[2], 6), "[fpas_ques]" => $data[3], "[fpas_answ]" => $data[4]);
foreach ($replaces as $Key => $Value) {
$LostPasswordMessage04 = str_replace($Key, $Value, $LostPasswordMessage04);
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Mail.class.php";
$mail = new Mail();
$mailMsg = $mail->SendMail($mail_addr, $memb___id, $LostPasswordMessage03, $LostPasswordMessage04);
if ($mailMsg === true) {
$return = $LostPasswordMessage02;
$db->Query("INSERT INTO Z_LostPasswordLog (memb___id) VALUES ('{$memb___id}')");
} else {
$return = $LostPasswordMessage05;
if ($MainSiteDebug) {
$return .= $mailMsg;
}
}
return $return;
}
示例6: SendMessage
function SendMessage(&$db, $idx)
{
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/MailService2.php";
require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/MailList.php";
$db->Query("SELECT COUNT(idx) FROM Z_MailListSending WHERE msg_idx = '{$idx}'");
$data = $db->GetRow();
$toSend = $data[0];
if ($toSend == 0) {
return $MailListMessage06;
}
$db->Query("SELECT title, message FROM Z_MailListMessages WHERE idx = '{$idx}'");
$data = $db->GetRow();
$title = $data[0];
$message = $data[1];
$db->Query("SELECT TOP {$MailServiceMLPerSend} mail_addr FROM Z_MailListSending");
$NumRows = $db->NumRows();
for ($i = 0; $i < $NumRows; $i++) {
$data = $db->GetRow();
$bcc[$i] = $data[0];
}
$sends = $toSend / $MailServiceMLPerSend;
$seconds = $sends * ($MailServiceMLInterval + $_GET['time']);
$minutes = (int) ($seconds / 60);
if ($minutes > 59) {
$hours = (int) ($minutes / 60);
$minutes = (int) ($minutes % 60);
} else {
$hours = 0;
}
if ($hours > 23) {
$days = (int) ($hours / 24);
$hours = (int) ($hours % 24);
} else {
$days = 0;
}
$remainingTime = "{$days} {$MailListMessage19}, {$hours} {$MailListMessage20}, {$minutes} {$MailListMessage21}";
echo $MailListMessage14;
echo "<p> </p>";
echo $MailListMessage16 . $toSend;
echo "<br />";
echo $MailListMessage18 . $remainingTime;
echo "<p> </p>";
echo $MailListMessage17 . implode(", ", $bcc);
$delete = "IN('" . implode("', '", $bcc) . "')";
$InitTime = microtime(1);
require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Mail.class.php";
$mailCass = new Mail();
if ($MailServiceMLPerSend > 1) {
$sending = $mailCass->SendMail($MailServiceMLBindMail, $MailServiceMLBindName, $title, $message, $bcc, true);
} else {
if ($MailServiceMLPerSend == 1) {
$sending = $mailCass->SendMail($bcc[0], $MailServiceMLBindName, $title, $message, NULL, true);
}
}
$FinalTime = microtime(1);
$ProcessTime = (int) ($FinalTime - $InitTime);
if (!$sending) {
echo "<p>{$sending}</p>";
} else {
$db->Query("DELETE FROM Z_MailListSending WHERE mail_addr {$delete}");
}
echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"{$MailServiceMLInterval}; URL=?action=sending&idx=" . $_GET['idx'] . "&time={$ProcessTime}\">";
}