本文整理汇总了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");
}