本文整理汇总了PHP中Mail::setMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::setMessage方法的具体用法?PHP Mail::setMessage怎么用?PHP Mail::setMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail
的用法示例。
在下文中一共展示了Mail::setMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_filemanager_plugin_actions
//.........这里部分代码省略.........
if ($file->name != '') {
$permissions = explode("\n", $_['allow_user']);
if ($_['allow_all'] == 'true') {
$permissions[] = '*';
}
if ($_['allow_internal'] == 'true') {
$permissions[] = '$';
}
$file->setPermissions($permissions);
$file->save();
$response['success'] = true;
}
}
echo json_encode($response);
break;
case 'plugin_filemanager_send_mail':
header('Content-type: application/json');
require_once 'plugins/file/FileUploaded.class.php';
$response = array();
$file = new FileUploaded();
if (isset($_['id']) && isset($_['recipient'])) {
$file = $file->getById($_['id']);
if ($file->name != '') {
if ($file->checkPermission($myUser)) {
$file->addPermission('*');
$file->save();
$mail = new Mail();
$mail->disableBorder();
$mail->setExpeditor('"' . $myUser->getFullName() . '" <' . $myUser->getMail() . '>');
$mail->setReply('"' . $myUser->getFullName() . '" <' . $myUser->getMail() . '>');
$mail->addRecipient($_['recipient']);
$mail->addAttachment($file->name . '|' . $file->mime, file_get_contents($file->path));
$mail->setTitle("Pièce jointe - " . $file->name, false);
$mail->setMessage($_['message']);
$mail->send();
$response['success'] = true;
}
}
}
echo json_encode($response);
break;
case 'plugin_filemanager_search':
require_once 'plugins/file/FileUploaded.class.php';
$fileManager = new FileUploaded();
$keyword = isset($_['keyword']) && $_['keyword'] != '' ? $_['keyword'] : '';
$files = $fileManager->search($keyword);
foreach ($files as $file) {
if ($file->checkPermission($myUser)) {
?>
<div id="file_<?php
echo $file->id;
?>
" class="dz-preview dz-file-preview">
<div class="dz-details">
<div class="dz-filename"><a href="<?php
echo $file->getUrl();
?>
"><i class="fa fa-file-text-o"></i> <?php
echo $file->name;
?>
</a></div> -
<div class="dz-size" data-dz-size><strong><?php
echo $file->getSize();
?>
</strong></div>
<div class="dz-options"><ul class="dz-options"><li title="Envoyer par email" onclick="plugin_filemanager_send_mail_form(<?php
示例2: sendEmailToAdmin
public function sendEmailToAdmin()
{
$emailSender = new Mail();
$emailSender->setTo("sanketdhotre@couragedigital.com");
$emailSender->setFrom($this->email);
$emailSender->setMessage($this->createEmailMessageBodyForContact());
$emailSender->setSubject("An Email from " . $this->name . ".");
return $emailSender->sendEmail($emailSender);
}
示例3:
$oldpass = $_POST['oldpass'];
$newpass = $_POST['newpass'];
$reppass = $_POST['reppass'];
if (rtrim($curpass) == $oldpass) {
if ($newpass != $reppass) {
$error = "The password's you have entered do not match. Please try again.";
} else {
if (strlen($newpass) < 3 || strlen($newpass) > 15) {
$error = "Password must be between 3 and 15 characters!";
} else {
$new = $db->encrypt($_POST['newpass'], enc_key);
$db->setPassword($_SESSION['user']['username'], $new);
$_SESSION['user']['password'] = $new;
$mailer->setReceiver($_SESSION['user']['email']);
$mailer->setSubject("Password Change");
$mailer->setMessage("You've requested a password change. Your new password is as follows:<br><br>Your password: <b>" . $newpass . "</b>");
if ($mailer->sendMail()) {
$success = 'Your password has been set and emailed to you!';
} else {
$success = 'Your password has been set, but we were unable to send an email. Your new password: <b>' . $newpass . '</b>!';
}
}
}
} else {
$error = "Please check your current password and try again. '" . $curpass . "'";
}
}
if (isset($_POST['avatar'])) {
$url = filter_var($_POST['avatar'], FILTER_SANITIZE_URL);
if (empty($_POST['avatar'])) {
$db->setAvatarUrl($_SESSION['user']['username'], null);
示例4: Mail
<?php
$pack = 'contact-user';
$data['liensCSS']->add($pack, 'style03.css');
$page['path'] = $path['ressources'] . $pack . '/';
$data['namepage'] = 'Contact';
// Fil d'Ariane --
$data['navi']->add('?user=contact', 'Contacts');
if (isset($_POST['nom']) && isset($_POST['prenom']) && isset($_POST['email']) && isset($_POST['message'])) {
require $path['class'] . 'Mail.php';
$mail = new Mail();
$mail->setTo('elouan_p_c@yahoo.fr', 'Admin');
$mail->setTo($_POST['email'], $_POST['prenom'] . ' ' . $_POST['nom']);
$mail->setMessage($_POST['message']);
$mail->envoyer();
}
示例5:
$email = $_POST['email'];
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$error = "Invalid email address";
} else {
$valid = $db->checkEmail($email);
if ($valid == null) {
$error = "That email does not exist";
} else {
$success = "Your password has been emailed to you.";
$pass = $db->decrypt($valid['password'], enc_key);
$mailer->setReceiver($valid['email']);
$mailer->setSubject("Password Recovery");
$message = "You have requested your password, it is below:<br><br>";
$message .= "Username: <b>" . $valid['username'] . "</b><br>";
$message .= "Password: <b>" . $pass . "</b><br>";
$mailer->setMessage($message);
$mailer->sendMail();
}
}
}
?>
<!DOCTYPE html>
<html>
<?php
include 'assets/templates/global/head.php';
?>
<body>
<div class="container text-center" style="width:300px;">
<div class="col-md-12 col-md-12">
<h1 class="text-primary text-center">Recover</h1>