本文整理汇总了PHP中Mail::sendMail方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::sendMail方法的具体用法?PHP Mail::sendMail怎么用?PHP Mail::sendMail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::sendMail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sample3
public function sample3()
{
$data = array('John', 'john@example.com', 'Sydney, NSW', 'Australia', 12, 06, 1980, '02 123 45678', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');
$template_html = 'sample-3.txt';
$mail = new Mail();
$mail->setMailBody($data, $template_html, 'TEXT');
$mail->sendMail('Test Sample 3 Text Plain Template Format');
exit('Email Sample 3');
}
示例2: sendPasswordResetMail
/**
* Send the password reset mail
*
* @param string $user_name username
* @param string $user_password_reset_hash password reset hash
* @param string $user_email user email
*
* @return bool success status
*/
public static function sendPasswordResetMail($user_name, $user_password_reset_hash, $user_email)
{
// create email body
$body = Config::get('EMAIL_PASSWORD_RESET_CONTENT') . ' ' . Config::get('URL') . Config::get('EMAIL_PASSWORD_RESET_URL') . '/' . urlencode($user_name) . '/' . urlencode($user_password_reset_hash);
// create instance of Mail class, try sending and check
$mail = new Mail();
$mail_sent = $mail->sendMail($user_email, Config::get('EMAIL_PASSWORD_RESET_FROM_EMAIL'), Config::get('EMAIL_PASSWORD_RESET_FROM_NAME'), Config::get('EMAIL_PASSWORD_RESET_SUBJECT'), $body);
if ($mail_sent) {
Session::add('feedback_positive', Text::get('FEEDBACK_PASSWORD_RESET_MAIL_SENDING_SUCCESSFUL'));
return true;
}
Session::add('feedback_negative', Text::get('FEEDBACK_PASSWORD_RESET_MAIL_SENDING_ERROR') . $mail->getError());
return false;
}
示例3: AddUser
public function AddUser()
{
global $mysqli, $emailActivation, $websiteUrl, $db_table_prefix;
//Prevent this function being called if there were construction errors
if ($this->status) {
//Construct a secure hash for the plain text password
$secure_pass = generateHash($this->clean_password);
//Construct a unique activation token
$this->activation_token = generateActivationToken();
//Do we need to send out an activation email?
if ($emailActivation == "true") {
//User must activate their account first
$this->user_active = 0;
$mail = new Mail();
//Build the activation message
$activation_message = lang("ACCOUNT_ACTIVATION_MESSAGE", array($websiteUrl, $this->activation_token));
//Define more if you want to build larger structures
$hooks = array("searchStrs" => array("#ACTIVATION-MESSAGE", "#ACTIVATION-KEY", "#USERNAME#"), "subjectStrs" => array($activation_message, $this->activation_token, $this->displayname));
/* Build the template - Optional, you can just use the sendMail function
Instead to pass a message. */
if (!$mail->newTemplateMsg("new-registration.txt", $hooks)) {
$this->mail_failure = true;
} else {
//Send the mail. Specify users email here and subject.
//SendMail can have a third parementer for message if you do not wish to build a template.
if (!$mail->sendMail($this->clean_email, "New User")) {
$this->mail_failure = true;
}
}
$this->success = lang("ACCOUNT_REGISTRATION_COMPLETE_TYPE2");
} else {
//Instant account activation
$this->user_active = 1;
$this->success = lang("ACCOUNT_REGISTRATION_COMPLETE_TYPE1");
}
if (!$this->mail_failure) {
//Insert the user into the database providing no errors have been found.
$stmt = $mysqli->prepare("INSERT INTO " . $db_table_prefix . "users (\n\t\t\t\t\tuser_name,\n\t\t\t\t\tdisplay_name,\n\t\t\t\t\tpassword,\n\t\t\t\t\temail,\n\t\t\t\t\tactivation_token,\n\t\t\t\t\tlast_activation_request,\n\t\t\t\t\tlost_password_request, \n\t\t\t\t\tactive,\n\t\t\t\t\ttitle,\n\t\t\t\t\tsign_up_stamp,\n\t\t\t\t\tlast_sign_in_stamp\n\t\t\t\t\t)\n\t\t\t\t\tVALUES (\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t?,\n\t\t\t\t\t'" . time() . "',\n\t\t\t\t\t'0',\n\t\t\t\t\t?,\n\t\t\t\t\t'New Member',\n\t\t\t\t\t'" . time() . "',\n\t\t\t\t\t'0'\n\t\t\t\t\t)");
$stmt->bind_param("sssssi", $this->username, $this->displayname, $secure_pass, $this->clean_email, $this->activation_token, $this->user_active);
$stmt->execute();
$inserted_id = $mysqli->insert_id;
$stmt->close();
//Insert default permission into matches table
$stmt = $mysqli->prepare("INSERT INTO " . $db_table_prefix . "user_permission_matches (\n\t\t\t\t\tuser_id,\n\t\t\t\t\tpermission_id\n\t\t\t\t\t)\n\t\t\t\t\tVALUES (\n\t\t\t\t\t?,\n\t\t\t\t\t'1'\n\t\t\t\t\t)");
$stmt->bind_param("s", $inserted_id);
$stmt->execute();
$stmt->close();
}
}
}
示例4: sendMail
/**
* Envoi un email
* @return object 2 attributs, bool success et array string msg
*/
public function sendMail()
{
$resCheck = $this->check();
$res = $resCheck;
if ($resCheck->success === true) {
$param = array('pseudo' => 'Admin', 'pseudoExpediteur' => $this->pseudo, 'emailExpediteur' => $this->email, 'sujet' => $this->sujet, 'message' => nl2br($this->message));
$mail = new Mail(DESTINATAIRE_MAIL_CONTACT, '[Technote] Contact', 'mail_contact.twig', $param);
$resMail = $mail->sendMail();
$res->success = $resCheck->success && $resMail->success;
$res->msg = array_merge($res->msg, $resMail->msg);
if ($resMail->success === true && !empty($_SESSION['user'])) {
$actionDAO = new ActionDAO(BDD::getInstancePDO());
$action = new Action(array('id_action' => DAO::UNKNOWN_ID, 'libelle' => 'Contact par formulaire', 'id_membre' => $_SESSION['user']->id_membre));
$actionDAO->save($action);
}
}
return $res;
}
示例5: send_reset_password_email
function send_reset_password_email($emailAddress, $randomPassword)
{
require_once 'com/tcshl/mail/Mail.php';
$emailBody = 'Your password has been reset to ' . $randomPassword;
//$sender,$recipients,$subject,$body
$Mail = new Mail(VERIFICATION_EMAIL_SENDER, $emailAddress, RESET_PASSWORD_EMAIL_SUBJECT, $emailBody);
$Mail->sendMail();
}
示例6: partnerInform
/**
* Siunciamas laiskas partneriui apie vieluojamus atapus
* @return bool
*/
function partnerInform()
{
$dates = array($this->currDate, $this->minusDaysFromGetDate(1), $this->minusDaysFromGetDate(2));
$todayEventList = $this->getEventList($dates, 1);
if (!$todayEventList) {
return FALSE;
}
echo "<pre>";
//var_dump($todayEventList);
echo "</pre>";
//return;
$projectList = array();
if (count($todayEventList) > 0) {
foreach ($todayEventList as $event) {
if (!isset($projectList[$event->getPid()])) {
$projectList[$event->getPid()] = array();
}
array_push($projectList[$event->getPid()], $event);
}
}
if (count($projectList) < 1) {
return false;
}
//var_dump($projectList);
$messageTextHead = "";
$messageTextHead .= "<table>";
$messageTextHead .= "<tr><td>Sveiki,</td></tr>";
$messageTextHead .= "<tr><td> </td></tr>";
foreach ($projectList as $key => $currProject) {
$sendMailToday = false;
$sendMailYesterday = false;
$project = $this->getProjectById($key);
$partner = $this->getPartnerByProjectId($key);
if (!$project) {
$this->sendErrorMail("Nepavyko nuskaityti projekto pagal ID. [01]");
continue;
}
if (!$partner) {
$this->sendErrorMail("Nepavyko nuskaityti parnerio pagal projekto ID [02]");
continue;
}
//$messageText = $messageTextHead;
$messageTextToday = "<tr><td>Projekte <strong>" . htmlspecialchars($project->getName()) . "</strong>, pasibaigė kliento(ų) etapai:</td></tr>";
$messageTextToday .= "<tr><td> </td></tr>";
$messageTextToday .= "<tr><td><table>";
$messageTextToday .= "<tr><th style='border-bottom: 1px solid #000000;'>Klientas</th><th style='border-bottom: 1px solid #000000;'>Etapas</th><th style='border-bottom: 1px solid #000000;'>Pabaigos data</th></tr>";
$messageTextYesterday = "<tr><td><table>";
$messageTextYesterday .= "<tr><th style='border-bottom: 1px solid #000000;'>Klientas</th><th style='border-bottom: 1px solid #000000;'>Etapas</th><th style='border-bottom: 1px solid #000000;'>Pabaigos data</th></tr>";
foreach ($currProject as $event) {
$stage = $this->getStageById($event->getSid());
$client = $this->getClientById($event->getCid());
if ($client && (!$client->isActive() || $client->isEnded() || $client->isMoved())) {
continue;
}
var_dumpas($this->currDate);
//if($event->getValid_date() == $this->currDate){
/*if (substr($event->getValid_date(),0,10) == $this->currDate){*/
$sendMailToday = true;
$messageTextToday .= "<tr><td>" . (!$client ? "-" : htmlspecialchars($client->getName()) . " " . htmlspecialchars($client->getEmail())) . "</td>";
$messageTextToday .= "<td>" . (!$stage ? "-" : htmlspecialchars($stage->getName())) . "</td>";
$messageTextToday .= "<td>" . addslashes($event->getValid_date()) . "</td></tr>";
/*} else {
$sendMailYesterday = true;
$messageTextYesterday .= "<tr><td>". (!$client ? "-" : htmlspecialchars($client->getName()) ." ". htmlspecialchars($client->getEmail())) ."</td>";
$messageTextYesterday .= "<td>". (!$stage ? "-" : htmlspecialchars($stage->getName())) ."</td>";
$messageTextYesterday .= "<td>". htmlspecialchars($event->getValid_date()) ."</td></tr>";
}*/
}
$messageTextToday .= "</table></td></tr>";
$messageTextToday .= "<tr><td> </td></tr>";
$messageTextYesterday .= "</table></td></tr>";
$messageTextYesterday .= "<tr><td> </td></tr>";
if (!$sendMailToday && !$sendMailYesterday) {
continue;
}
$messageText = $messageTextHead;
if ($sendMailToday) {
$messageText .= $messageTextToday;
}
if ($sendMailYesterday) {
if ($sendMailToday) {
$messageText .= "<tr><td>Taip pat vėluojate užbaigti/nukelti kliento(ų) etapus:</td></tr>";
} else {
$messageText .= "<tr><td>Projekte <strong>" . htmlspecialchars($project->getName()) . "</strong>, vėluojate užbaigti/nukelti kliento(ų) etapus:</td></tr>";
}
$messageText .= "<tr><td> </td></tr>";
$messageText .= $messageTextYesterday;
}
$messageText .= "<tr><td>Prašome paspausti ant nuorodos žemiau ir užbaigti arba nukelti etapą(us).</td></tr>";
$messageText .= "<tr><td>" . addslashes(htmlspecialchars($this->partnerUrl)) . addslashes(htmlspecialchars($project->getCruid())) . "</td></tr>";
$messageText .= "</table>";
//echo $messageText;
//echo $messageText;
$mail_ob = new Mail();
$mail_ob->setTo($partner->getEmail());
//$mail_ob->setTo("just.urbonas@gmail.com");
//.........这里部分代码省略.........
示例7: foreach
}
$servicios->RegistrarContrato($Contrato["codigo"], $Contrato["numeroContrato"], $Contrato["ubicacionContratoFisico"], $Contrato["fechaInicioContrato"], $Contrato["fechaFinContrato"], $Contrato["direccionExactaPredio"], $Contrato["T_Cliente_codigo"], ContratoPendiente, $Contrato["T_Predio_codigo"], $Contrato["observaciones"]);
$data = $servicios->ListarDetalleContrato($Contrato['codigo']);
foreach ($data as $i) {
$group[$i['nombrePlan']][] = array("tarifaPlan" => $i['tarifaPlan']);
}
while (current($group)) {
$name[] = key($group);
next($group);
}
if ($data) {
foreach ($name as $value) {
$plan .= $value;
}
}
$cuerpoMensaje2 = array(5 => array('nombre' => 'Celular', 'valor' => $Contrato['telefonoCelularContacto']), 6 => array('nombre' => 'Telefono:', 'valor' => $Contrato['telefonoFijoContacto']), 7 => array('nombre' => 'Correo de Trabajo:', 'valor' => $Contrato['correoTrabajoContacto']), 8 => array('nombre' => 'Correo personal:', 'valor' => $Contrato['correoPersonalContacto']), 9 => array('nombre' => 'Estado Cliente:', 'valor' => $Contrato['descripcionEstadoCliente']), 10 => array('nombre' => 'Dirección del Predio:', 'valor' => $Contrato['direccionExactaPredio']), 11 => array('nombre' => 'Nombre del Predio:', 'valor' => $Contrato['nombrePredio']));
$cuerpoMensaje3 = array_merge($cuerpoMensaje1, $cuerpoMensaje2);
$SubjectPredioFactible = 'Plan: ' . $plan . ' [' . $tipo . '] -- Estado : Contratar por Web';
$Mail->sendMail($SubjectPredioFactible . '' . $ordenInstalacion['codigo'], $cuerpoMensaje3, VENTAS, 'bodyMail');
}
// if ((int) ["T_EstadoPredio_codigo"] == InstalacionPotencial && (int) $_POST['T_EstadoPredio_codigo'] == PredioNoFactible) {
//
// }
$RegistrarClienteNatural = $servicios->RegistrarPredio((int) $_POST['codigo'], strtoupper($_POST['nombre']), strtoupper($_POST['direccion']), $_POST['numeroEspacios'], strtoupper($_POST['capacidadSplitter']), $_POST['latitud'], $_POST['longitud'], $_POST['tieneONTenRecepcion'], (int) $_POST['departamento'], (int) $_POST['provincia'], (int) $_POST['distrito'], (int) $_POST['T_TipoPredio_codigo'], (int) $_POST['T_EstadoPredio_codigo']);
$estado = $RegistrarClienteNatural['estado'];
if ($estado == 1) {
header('Location: /' . AMBIENTE . '/modulos/Predios/listar-predios.phtml?me=1');
} else {
header('Location: /' . AMBIENTE . '/modulos/Predios/listar-predios.phtml?me=2');
}
}
示例8: Mail
$total2 = mysql_num_rows($res);
//if($total==1 && $total2==0 && $total1!=$row['no_of_student'])
//{
$start_name = $_POST['txtemail_id'];
$field = 'upload_photo';
$dest = '../student/upload_photo';
$image = Upload::image($field, $dest, $start_name);
$condition = "ID='" . $_POST['txtname'] . "'";
$set_value = "contact_person='" . $_POST['txtfathers_name'] . "', image='{$image}', date_of_birth='" . $_POST['year'] . "/" . $_POST['month'] . "/" . $_POST['day'] . "', address='" . $_POST['txtaddress'] . "', contact_no='" . $_POST['txtcontact_no'] . "', email='" . $_POST['txtemail_id'] . "', alt_contact='" . $_POST['txtalt_contact'] . "', password='{$ranStr}', status='" . $_POST['txtplacement_req'] . "', type='st'";
$r = Model::update($tablename, $set_value, $condition);
if ($r) {
$email = $_POST['txtemail_id'];
$message = "Your Registration Succesfuly! Your Email ID-:" . $email . " and Password-:" . $ranStr;
$subject = "Registration";
$mail = new Mail($subject, $message, $email);
$a = $mail->sendMail();
if ($a) {
header("Location:../Main Content/welcome_message.php?title=registration");
}
}
/*}
else if($total2!=0)
{
echo "<script>alert('please enter correct batch id and email id');history.back();</script>";
}
else if($total==0)
{
echo "<script>alert('please enter correct batch id');history.back();</script>";
}
else if($total1==$row['no_of_student'])
{
示例9: importAction
function importAction()
{
if (!isset($_POST['client'])) {
$this->setOutPut(array("error" => $this->errorCode['param_not_found']));
return false;
}
$client = json_decode(urldecode($_POST['client']));
//$client = $this->utf8Decode($client1);
//var_dumpas($client['projectKey']);
if (!isset($client->projectKey) || is_null($client->projectKey)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
$project = $this->getProject($client->projectKey, $client);
if (!is_object($project)) {
return false;
}
if (!isset($client->name) || is_null($client->name)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
if (!isset($client->email) || is_null($client->email)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
if (!isset($client->telephone) || is_null($client->telephone)) {
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}
/*if (!isset($client->comment) || is_null($client->comment)){
$this->setOutPut(array("error" => $this->errorCode['wrong_param']));
return false;
}*/
$now = Carbon::Now();
//Kuriam nauja klienta
$newClient = new Client();
$newClient->setPid($project->getId());
$newClient->setName(substr($client->name, 0, 255));
$newClient->setEmail(substr($client->email, 0, 255));
$newClient->setTelephone(substr($client->telephone, 0, 50));
$newClient->setComment(substr($client->comment, 0, 255));
$newClient->setCustomer(substr($client->customer, 0, 255));
$newClient->setActive(true);
$newClient->setPeriodical(false);
$newClient->setPeriodicalid(0);
$newClient->setR_date($now->toDateTimeString());
$newClient->setR_user(977);
$store = $this->storeClient($newClient);
if (!$store) {
$this->setOutPut(array("error" => $this->errorCode['client_not_stored']));
$mail_ob = new Mail();
$mail_ob->setTo("just.urbonas@gmail.com");
$mail_ob->setText(print_r($newClient, true));
$mail_ob->setSubject("WorkFlow.kaizensistema.lt | Nepavyko sukurti importo kliento.");
$mail_ob->sendMail();
return false;
} else {
$eventHistory = new EventHistory();
$eventHistory->setPid($newClient->getPid());
$eventHistory->setCid($newClient->getId());
$eventHistory->setR_date($newClient->getR_date());
$eventHistory->setDescription(!is_null($client->from) ? $client->from : "Sukurtas integracijos metu");
$this->storeEventHistory($eventHistory);
}
$this->setOutPut(array("ok" => "ok"));
}
示例10: email_contact_page_message
function email_contact_page_message($emailAddress = "", $emailSubject = "", $emailBody = "")
{
require_once 'com/tcshl/mail/Mail.php';
//$sender,$recipients,$subject,$body
$Mail = new Mail(TCSHL_EMAIL, $emailAddress, $emailSubject, $emailBody);
$Mail->sendMail();
}
示例11: actionChangeClientStatus
function actionChangeClientStatus($currentProject)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$id = $this->context->getRequestAttr("id");
$activePOZ = $this->context->getRequestAttr("active");
$projectID = $this->context->getRequestAttr("projectID");
$stageId = $this->context->getRequestAttr("stageID");
$eventId = $this->context->getRequestAttr("eventID");
if (is_null($id)) {
$this->context->setRequestScopeAttr("error", "client.error.notfound");
$this->cancelClientView();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$client = $this->clientDaol->get($id);
if (is_null($client)) {
$this->context->setRequestScopeAttr("error", "client.error.notfound");
$this->cancelClientView();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
} else {
if (is_string($client)) {
$this->context->setRequestScopeAttr("error", "error.dberror");
$this->context->setRequestScopeAttr("errortxt", $client);
$client = null;
$this->cancelClientView();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
}
$stage = $this->stageDao->get($stageId);
if (!is_object($stage)) {
$this->context->setRequestScopeAttr("error", "stage.error.notfound");
$this->cancelClientView();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$client->setActive($activePOZ);
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$client->setR_date($time->format("Y-m-d H:i:s"));
$client->setR_user(0);
$store = $this->storeClient($client);
if (!$store) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$eventHistory = new EventHistory();
$eventHistory->setPid($client->getPid());
$eventHistory->setCid($client->getId());
$eventHistory->setR_date($client->getR_date());
$eventHistory->setDescription(($client->isActive() ? "Atsisakytas" : "Atsisakytas") . " partnerio");
$eventHistory->setComment($this->context->getRequestAttr("pozcomment"));
if (!is_null($eventHistory->getComment())) {
$eventHistory->setComment(trim($eventHistory->getComment()));
if (strlen($eventHistory->getComment()) < 1) {
$eventHistory->setComment(null);
}
}
$this->storeEventHistory($eventHistory);
$proj = $this->projectDao->get($client->getPid());
$user = $this->userDao->get($proj->getOwner());
$messageText = $this->mailPatterns->suspendClientText;
$messageText = str_replace("<PROJECT>", htmlspecialchars($proj->getName()), $messageText);
$messageText = str_replace("<CLIENT>", htmlspecialchars($client->getName()) . " " . htmlspecialchars($client->getEmail()) . " " . htmlspecialchars($client->getTelephone()), $messageText);
$messageText = str_replace("<LINKAS>", htmlspecialchars($this->projectUrl) . htmlspecialchars($proj->getCruid()), $messageText);
$messageText = str_replace("<PRIEZASTIS>", htmlspecialchars($eventHistory->getComment()), $messageText);
$mail_ob = new Mail();
$mail_ob->setTo($user->getUser());
$mail_ob->setText($messageText);
$mail_ob->setSubject($this->mailPatterns->suspendClientSubject . $proj->getName());
$mail_ob->sendMail();
$this->logEmeilSend($mail_ob);
if ($stage->getCancel_customer() != 0) {
$action = $stage->getCancel_customer() == 1 ? "copy" : "move";
$projects = explode(",", $stage->getCancel_customer_pid());
foreach ($projects as $projectId) {
$this->moveCopyClient($client, $projectId, $action);
}
}
$this->cancelClientView();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
//.........这里部分代码省略.........
示例12: hash
$auth->resetPassword = 0;
$auth->disabled = 1;
$auth->save();
//create login hash
$hash = hash('whirlpool', $user->authentication->identity . time() . (time() / 64));
if( !Quick_Login::add($hash, $user->userid, time() + 3600, 0) ){
// die
}
//load email template
ob_start();
include('templates/account_create.html');
$body = ob_get_clean();
if( Mail::sendMail($user->contact->email, 'no-reply-automator@afterthought.thomasrandolph.info', "Afterthought System Database Email Verification", $body) ){
//redirect to login
throw new RedirectBrowserException("/index.php?code=6");
}
}
else{
throw new RedirectBrowserException("/index.php?a=request&code=8&" . http_build_query($data));
}
}
else{
throw new RedirectBrowserException("/index.php?a=request&code=7&" . http_build_query($data));
}
}
else{
throw new RedirectBrowserException("/index.php?a=request&code=5&" . http_build_query($data));
}
示例13: sendNewProjectUrl
function sendNewProjectUrl($user, $project, $type = "partnerUrl")
{
$mail_ob = new Mail();
$mail_ob->setTo($user->getEmail());
if ($type == "partnerUrl") {
$subject = $this->mailPatterns->projectUrlSendSubject;
} else {
$subject = $this->mailPatterns->projectRssUrlSendSubject;
}
$subject = str_replace("<PROJECT>", htmlspecialchars($project->getName()), $subject);
$mail_ob->setSubject($subject);
if ($type == "partnerUrl") {
$mail_text = $this->mailPatterns->projectUrlSendText;
$mail_text = str_replace("<URL>", htmlspecialchars($this->partnerUrl) . htmlspecialchars($project->getCruid()), $mail_text);
} else {
$mail_text = $this->mailPatterns->projectRssUrlSendText;
$mail_text = str_replace("<URL>", htmlspecialchars($this->rssUrl) . htmlspecialchars($project->getRsskey()) . ".rss", $mail_text);
}
$mail_text = str_replace("<PROJECT>", htmlspecialchars($project->getName()), $mail_text);
$mail_text = str_replace("<URL>", htmlspecialchars($this->partnerUrl) . htmlspecialchars($project->getCruid()), $mail_text);
$mail_ob->setText($mail_text);
$mail_ob->sendMail();
$this->logEmeilSend($mail_ob);
}
示例14: user_create_account
function user_create_account($register_data, $maildata)
{
array_walk($register_data, 'array_sanitize');
if (config('TFSVersion') == 'TFS_03' && config('salt') === true) {
$register_data['salt'] = generate_recovery_key(18);
$register_data['password'] = sha1($register_data['salt'] . $register_data['password']);
} else {
$register_data['password'] = sha1($register_data['password']);
}
$ip = $register_data['ip'];
$created = $register_data['created'];
unset($register_data['ip']);
unset($register_data['created']);
if (config('TFSVersion') == 'TFS_10') {
$register_data['creation'] = $created;
}
$fields = '`' . implode('`, `', array_keys($register_data)) . '`';
$data = '\'' . implode('\', \'', $register_data) . '\'';
mysql_insert("INSERT INTO `accounts` ({$fields}) VALUES ({$data})");
$account_id = user_id($register_data['name']);
$activeKey = rand(100000000, 999999999);
mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`, `activekey`) VALUES ('{$account_id}', '{$ip}', '{$created}', '{$activeKey}')");
if ($maildata['register']) {
$thisurl = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$thisurl .= "?authenticate&u=" . $account_id . "&k=" . $activeKey;
$mailer = new Mail($maildata);
$title = "Please authenticate your account at {$_SERVER['HTTP_HOST']}.";
$body = "<h1>Please click on the following link to authenticate your account:</h1>";
$body .= "<p><a href='{$thisurl}'>{$thisurl}</a></p>";
$body .= "<p>Thank you for registering and enjoy your stay at {$maildata['fromName']}.</p>";
$body .= "<hr><p>I am an automatic no-reply e-mail. Any emails sent back to me will be ignored.</p>";
$mailer->sendMail($register_data['email'], $title, $body, $register_data['name']);
}
}
示例15: Auth
if ($userId != 0 && $_GET['sendMessage'] == 'true') {
require_once _ENGINE . 'Mail.class.php';
require_once _ENGINE . 'Auth.class.php';
require_once _ENGINE . 'HTML.class.php';
$Auth = new Auth($Db);
$HTML = new HTML();
$HTML->get('template/activationMail.html');
$code = $Auth->generateCode(40);
$isAdd = $Db->insert('userActivation', array('code', 'user'), array($code, $userId));
$HTML->replace(array('siteName', 'siteUrl', 'code'), array(_SITENAME, _SITEURL, $code));
$MailSender = new Mail();
$headers = array('From: Blinnaya76 <blinnaya76.ru>');
$MailSender->setHeaders($headers);
$MailSender->sendTo($data->mail);
$MailSender->setHTML($HTML->get());
$MailSender->sendMail();
}
}
/**
* Пользователи
* @method: Получить данные пользователя по ид
* @params: ID пользователя
* */
if ($_a == 'getUser') {
$id = $_GET['id'];
$res = $Db->select('SELECT id, login, f, i, o, type, email FROM user WHERE id = ' . $Db->quote($id));
if ($res) {
$_RETURN['status'] = 1;
$_RETURN['data'] = $res[0];
} else {
$_RETURN['status'] = -1;