本文整理匯總了PHP中ilMail::sendMimeMail方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilMail::sendMimeMail方法的具體用法?PHP ilMail::sendMimeMail怎麽用?PHP ilMail::sendMimeMail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilMail
的用法示例。
在下文中一共展示了ilMail::sendMimeMail方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteOwnAccount4
/**
* Delete own account dialog - action incl. notification email
*/
protected function deleteOwnAccount4()
{
global $ilUser, $ilAuth, $ilSetting, $ilLog;
if (!(bool) $ilSetting->get('user_delete_own_account') || $ilUser->getId() == SYSTEM_USER_ID || !$ilUser->hasDeletionFlag()) {
$this->ctrl->redirect($this, "showGeneralSettings");
}
// build notification
include_once "./Services/Notification/classes/class.ilSystemNotification.php";
$ntf = new ilSystemNotification();
$ntf->setLangModules(array("user"));
$ntf->addAdditionalInfo("profile", $ilUser->getProfileAsString($this->lng), true);
// mail message
ilDatePresentation::setUseRelativeDates(false);
$ntf->setIntroductionDirect(sprintf($this->lng->txt("user_delete_own_account_email_body"), $ilUser->getLogin(), ILIAS_HTTP_PATH, ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX))));
$message = $ntf->composeAndGetMessage($ilUser->getId(), null, null, true);
$subject = $this->lng->txt("user_delete_own_account_email_subject");
// send notification
include_once "Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
$user_email = $ilUser->getEmail();
$admin_mail = $ilSetting->get("user_delete_own_account_email");
// to user, admin as bcc
if ($user_email) {
$mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null, true);
} else {
if ($admin_mail) {
$mail->sendMimeMail($admin_mail, null, null, $subject, $message, null, true);
}
}
$ilLog->write("Account deleted: " . $ilUser->getLogin() . " (" . $ilUser->getId() . ")");
$ilUser->delete();
// terminate session
$ilAuth->logout();
session_destroy();
ilUtil::redirect("login.php?accdel=1");
}
示例2: sendUserResultsMail
public function sendUserResultsMail($a_active_id, $a_recipient)
{
global $ilUser;
$finished = $this->object->getSurveyParticipants(array($a_active_id));
$finished = array_pop($finished);
$finished = ilDatePresentation::formatDate(new ilDateTime($finished["finished_tstamp"], IL_CAL_UNIX));
require_once "Services/Mail/classes/class.ilMail.php";
require_once "Services/Link/classes/class.ilLink.php";
$body = ilMail::getSalutation($ilUser->getId()) . "\n\n";
$body .= $this->lng->txt("svy_mail_own_results_body") . "\n";
$body .= "\n" . $this->lng->txt("obj_svy") . ": " . $this->object->getTitle() . "\n";
$body .= ilLink::_getLink($this->object->getRefId(), "svy") . "\n";
$body .= "\n" . $this->lng->txt("survey_results_finished") . ": " . $finished . "\n\n";
$body .= $this->getUserResultsPlain($a_active_id);
// $body .= ilMail::_getAutoGeneratedMessageString($this->lng);
$body .= ilMail::_getInstallationSignature();
require_once "Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
$mail->sendMimeMail($a_recipient, null, null, sprintf($this->lng->txt("svy_mail_own_results_subject"), $this->object->getTitle()), $body, null, true);
}
示例3: deleteOwnAccount4
/**
* Delete own account dialog - action incl. notification email
*/
protected function deleteOwnAccount4()
{
global $ilUser, $ilAuth, $ilSetting, $ilLog;
if (!(bool) $ilSetting->get('user_delete_own_account') || $ilUser->getId() == SYSTEM_USER_ID || !$ilUser->hasDeletionFlag()) {
$this->ctrl->redirect($this, "showGeneralSettings");
}
include_once "Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
// send mail(s)
$subject = $this->lng->txt("user_delete_own_account_email_subject");
$message = $this->lng->txt("user_delete_own_account_email_body");
// salutation/info
ilDatePresentation::setUseRelativeDates(false);
$message = ilMail::getSalutation($ilUser->getId()) . "\n\n" . sprintf($message, $ilUser->getLogin(), ILIAS_HTTP_PATH, ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
// add profile data (see ilAccountRegistrationGUI)
$message .= "\n\n" . $ilUser->getProfileAsString($this->lng);
// signatur
$message .= ilMail::_getInstallationSignature();
$user_email = $ilUser->getEmail();
$admin_mail = $ilSetting->get("user_delete_own_account_email");
// to user, admin as bcc
if ($user_email) {
$mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null, true);
} else {
if ($admin_mail) {
$mail->sendMimeMail($admin_mail, null, null, $subject, $message, null, true);
}
}
$ilLog->write("Account deleted: " . $ilUser->getLogin() . " (" . $ilUser->getId() . ")");
$ilUser->delete();
// terminate session
$ilAuth->logout();
session_destroy();
ilUtil::redirect("login.php?accdel=1");
}