当前位置: 首页>>代码示例>>PHP>>正文


PHP Mail::setBody方法代码示例

本文整理汇总了PHP中Mail::setBody方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail::setBody方法的具体用法?PHP Mail::setBody怎么用?PHP Mail::setBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mail的用法示例。


在下文中一共展示了Mail::setBody方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: notifyOnDisable

 /**
  * Send a mail when PDF Watermarking is disabled.
  * 
  * @param Docman_Item $item
  * @param User        $currentUser
  * 
  * @return void
  */
 public function notifyOnDisable($item, $currentUser, $defaultUrl)
 {
     $admins = $this->getPeopleToNotifyWhenWatermarkingIsDisabled($item);
     $link = get_server_url() . $defaultUrl . '&action=details&id=' . $item->getId();
     $mail = new Mail();
     $mail->setTo(implode(',', $admins));
     $mail->setSubject($GLOBALS['Language']->getText('plugin_docmanwatermark', 'email_disable_watermark_subject', array($item->getTitle())));
     $mail->setBody($GLOBALS['Language']->getText('plugin_docmanwatermark', 'email_disable_watermark_body', array($item->getTitle(), $currentUser->getRealname(), $link)));
     $mail->send();
 }
开发者ID:nterray,项目名称:tuleap,代码行数:18,代码来源:DocmanWatermark_ItemFactory.class.php

示例2: send_new_user_email

function send_new_user_email($to, $confirm_hash, $username)
{
    //needed by new_user_email.txt
    $base_url = get_server_url();
    include $GLOBALS['Language']->getContent('include/new_user_email');
    $mail = new Mail();
    $mail->setTo($to);
    $mail->setSubject($GLOBALS['Language']->getText('include_proj_email', 'account_register', $GLOBALS['sys_name']));
    $mail->setBody($message);
    $mail->setFrom($GLOBALS['sys_noreply']);
    return $mail->send();
}
开发者ID:pdaniel-frk,项目名称:tuleap,代码行数:12,代码来源:proj_email.php

示例3: execute

 /**
  * Send the email
  * @param $args array
  * @param $request PKPRequest
  */
 function execute($args, &$request)
 {
     $userDao =& DAORegistry::getDAO('UserDAO');
     $toUser =& $userDao->getUser($this->userId);
     $fromUser =& $request->getUser();
     import('lib.pkp.classes.mail.Mail');
     $email = new Mail();
     $email->addRecipient($toUser->getEmail(), $toUser->getFullName());
     $email->setFrom($fromUser->getEmail(), $fromUser->getFullName());
     $email->setSubject($this->getData('subject'));
     $email->setBody($this->getData('message'));
     $email->send();
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:18,代码来源:UserEmailForm.inc.php

示例4: send_new_user_email

function send_new_user_email($to, $confirm_hash, $username)
{
    global $Language;
    $base_url = get_server_url();
    // $message is defined in the content file
    include $Language->getContent('include/new_user_email');
    list($host, $port) = explode(':', $GLOBALS['sys_default_domain']);
    $mail = new Mail();
    $mail->setTo($to);
    $mail->setSubject($Language->getText('include_proj_email', 'account_register', $GLOBALS['sys_name']));
    $mail->setBody($message);
    $mail->setFrom($GLOBALS['sys_noreply']);
    return $mail->send();
}
开发者ID:nterray,项目名称:tuleap,代码行数:14,代码来源:proj_email.php

示例5: shutDownFunction

/**
 * Fatal Error Callback Function.
 *
 * Detects when a Fatal errror Ocurrs
 * and notifies it to support.
 *
 * @access public
 * @return void
 */
function shutDownFunction()
{
    $error = error_get_last();
    if ($error['type'] == 1) {
        $mail = new Mail();
        $mail->addRecipient("hyuchia@gmail.com");
        //$mail -> addRecipient("saavedra.f12@gmail.com");
        $mail->addHeader("From: Moco Comics Error Handler <noreply@moco-comics.com>");
        $mail->setSubject("Error Report");
        $mail->setBody('[' . $error["type"] . '] ' . $error["message"] . '\\nFatal error on line ' . $error["line"] . ' in file ' . $error["file"] . '\\nPHP ' . PHP_VERSION . ' (' . PHP_OS . ')');
        $mail->send();
        return true;
    }
}
开发者ID:HyuchiaDiego,项目名称:Kirino,代码行数:23,代码来源:aegis.php

示例6: notifyAdministrator

 public function notifyAdministrator(PFuser $user)
 {
     $user_name = $user->getUserName();
     $href_approval = get_server_url() . '/admin/approve_pending_users.php?page=pending';
     $from = ForgeConfig::get('sys_noreply');
     $to = ForgeConfig::get('sys_email_admin');
     $subject = $GLOBALS['Language']->getText('account_register', 'mail_approval_subject', $user_name);
     $body = stripcslashes($GLOBALS['Language']->getText('account_register', 'mail_approval_body', array(ForgeConfig::get('sys_name'), $user_name, $href_approval)));
     $mail = new Mail();
     $mail->setSubject($subject);
     $mail->setFrom($from);
     $mail->setTo($to, true);
     $mail->setBody($body);
     if (!$mail->send()) {
         $GLOBALS['Response']->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('global', 'mail_failed', $to));
     }
 }
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:17,代码来源:PendingUserNotifier.php

示例7: sendAthenaEmail

function sendAthenaEmail($name, $email, $esubject, $htmlBody, $docName = '', $docTitle = '')
{
    global $db;
    // mailid,addto,addname,subject,body,sent,incept
    $now = time();
    # Insert into DB
    $mailNew = new Mail();
    $mailNew->setAddto($email);
    $mailNew->setAddname($name);
    $mailNew->setSubject($esubject);
    $mailNew->setBody($htmlBody);
    $mailNew->setIncept($now);
    $mailNew->setDocname($docName);
    $mailNew->setDoctitle($docTitle);
    $mailNew->insertIntoDB();
    $email_done = '
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading">Email Sent</div></div>
<div class="panel-body">An email has been sent to ' . $name . ' on ' . $email . ' </div></div></div>';
    return $email_done;
}
开发者ID:athenasystems,项目名称:athena,代码行数:22,代码来源:athena_mail.php

示例8: Mail

 if ($page == 'admin_creation') {
     $admin_creation = true;
     $password = $request->get('form_pw');
     $login = $request->get('form_loginname');
     if ($request->get('form_send_email')) {
         //send an email to the user with th login and password
         $from = $GLOBALS['sys_noreply'];
         $to = $request->get('form_email');
         $subject = $Language->getText('account_register', 'welcome_email_title', $GLOBALS['sys_name']);
         include $Language->getContent('account/new_account_email');
         $mail = new Mail();
         $mail->setSubject($subject);
         $mail->setFrom($from);
         $mail->setTo($to, true);
         // Don't invalidate address
         $mail->setBody($body);
         if (!$mail->send()) {
             $GLOBALS['feedback'] .= "<p>" . $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin'])) . "</p>";
         }
     }
 }
 if ($GLOBALS['sys_user_approval'] == 0 || $admin_creation) {
     if (!$admin_creation) {
         if (!send_new_user_email($request->get('form_email'), $confirm_hash, $user_name)) {
             $GLOBALS['feedback'] .= "<p>" . $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin'])) . "</p>";
         }
     } else {
     }
     $content .= '<p><b>' . $Language->getText('account_register', 'title_confirm') . '</b>';
     if ($admin_creation) {
         if ($request->get('form_send_email')) {
开发者ID:amanikamail,项目名称:tuleap,代码行数:31,代码来源:register.php

示例9: sendNotificationMail

 /**
  * Manage the mail content and send it
  * 
  * @param User    $user
  * @param FRSFile $file
  * @param String  $bodyContent
  * @param Array   $option
  * 
  * @return Boolean
  */
 function sendNotificationMail($user, $file, $bodyContent, $option)
 {
     $mail = new Mail();
     $language = new BaseLanguage($GLOBALS['sys_supported_languages'], $GLOBALS['sys_lang']);
     $language->loadLanguage($user->getLanguageID());
     $subject = $GLOBALS['sys_name'] . ' Error in ' . $file->getFileLocation();
     $mail->setFrom($GLOBALS['sys_noreply']);
     $mail->setBcc($user->getEmail());
     $mail->setSubject($subject);
     $mail->setBody($language->getText('mail_system_event', $bodyContent, $option));
     return $mail->send();
 }
开发者ID:nterray,项目名称:tuleap,代码行数:22,代码来源:SystemEvent_COMPUTE_MD5SUM.class.php

示例10: handle_monitoring

function handle_monitoring($forum_id, $thread_id, $msg_id)
{
    global $feedback, $sys_lf, $Language;
    /*
    	Checks to see if anyone is monitoring this forum
    	If someone is, it sends them the message in email format
    */
    $res = news_read_permissions($forum_id);
    if (db_numrows($res) < 1) {
        //check if there are users monitoring specific threads
        $sql = sprintf('(SELECT user.email FROM forum_monitored_forums,user' . ' WHERE forum_monitored_forums.user_id=user.user_id' . ' AND forum_monitored_forums.forum_id=%d' . ' AND ( user.status="A" OR user.status="R" ))' . ' UNION (SELECT user.email FROM forum_monitored_threads,user' . ' WHERE forum_monitored_threads.user_id=user.user_id' . ' AND forum_monitored_threads.forum_id=%d' . ' AND forum_monitored_threads.thread_id=%d' . ' AND ( user.status="A" OR user.status="R" ))', db_ei($forum_id), db_ei($forum_id), db_ei($thread_id));
    } else {
        //we are dealing with private news, only project members are allowed to monitor
        $qry1 = "SELECT group_id FROM news_bytes WHERE forum_id=" . db_ei($forum_id);
        $res1 = db_query($qry1);
        $gr_id = db_result($res1, 0, 'group_id');
        $sql = "SELECT user.email from forum_monitored_forums,user_group,user" . " WHERE forum_monitored_forums.forum_id=" . db_ei($forum_id) . " AND user_group.group_id=" . db_ei($gr_id) . " AND forum_monitored_forums.user_id=user_group.user_id AND user_group.user_id=user.user_id";
    }
    $result = db_query($sql);
    $rows = db_numrows($result);
    if ($result && $rows > 0) {
        $tolist = implode(result_column_to_array($result), ', ');
        $sql = "SELECT groups.unix_group_name,user.user_name,user.realname,forum_group_list.forum_name," . "forum.group_forum_id,forum.thread_id,forum.subject,forum.date,forum.body " . "FROM forum,user,forum_group_list,groups " . "WHERE user.user_id=forum.posted_by " . "AND forum_group_list.group_forum_id=forum.group_forum_id " . "AND groups.group_id=forum_group_list.group_id " . "AND forum.msg_id=" . db_ei($msg_id);
        $result = db_query($sql);
        if ($result && db_numrows($result) > 0) {
            list($host, $port) = explode(':', $GLOBALS['sys_default_domain']);
            $mail = new Mail();
            $mail->setFrom($GLOBALS['sys_noreply']);
            $mail->setSubject("[" . db_result($result, 0, 'unix_group_name') . " - " . util_unconvert_htmlspecialchars(db_result($result, 0, 'forum_name')) . " - " . db_result($result, 0, 'user_name') . "] " . util_unconvert_htmlspecialchars(db_result($result, 0, 'subject')));
            $mail->setBcc($tolist);
            $url1 = get_server_url() . "/forum/monitor.php?forum_id=" . $forum_id;
            $url2 = get_server_url() . "/forum/monitor_thread.php?forum_id=" . $forum_id;
            $body = $Language->getText('forum_forum_utils', 'read_and_respond') . ": " . "\n" . get_server_url() . "/forum/message.php?msg_id=" . $msg_id . "\n" . $Language->getText('global', 'by') . ' ' . db_result($result, 0, 'user_name') . ' (' . db_result($result, 0, 'realname') . ')' . "\n\n" . util_unconvert_htmlspecialchars(db_result($result, 0, 'body')) . "\n\n______________________________________________________________________" . "\n" . $Language->getText('forum_forum_utils', 'stop_monitor_explain', array($url1, $url2));
            $mail->setBody($body);
            if ($mail->send()) {
                $feedback .= ' - ' . $Language->getText('forum_forum_utils', 'mail_sent');
            } else {
                //ERROR
                $feedback .= ' - ' . $GLOBALS['Language']->getText('global', 'mail_failed', array($GLOBALS['sys_email_admin']));
            }
            if (forum_is_monitored($forum_id) || forum_thread_is_monitored($thread_id)) {
                $feedback .= ' - ' . $Language->getText('forum_forum_utils', 'people_monitoring');
            }
        } else {
            $feedback .= ' ' . $Language->getText('forum_forum_utils', 'mail_not_sent') . ' ';
            echo db_error();
        }
    } else {
        $feedback .= ' ' . $Language->getText('forum_forum_utils', 'mail_not_sent') . ' - ' . $Language->getText('forum_forum_utils', 'no_one_monitoring') . ' ';
        echo db_error();
    }
}
开发者ID:nterray,项目名称:tuleap,代码行数:52,代码来源:forum_utils.php

示例11: sendPageRenameNotification

 /** support mass rename / remove (not yet tested)
  */
 function sendPageRenameNotification($to, &$meta, $emails, $userids)
 {
     global $request;
     if (@is_array($request->_deferredPageRenameNotification)) {
         $request->_deferredPageRenameNotification[] = array($this->_pagename, $to, $meta, $emails, $userids);
     } else {
         $oldname = $this->_pagename;
         // Codendi specific
         $subject = sprintf(_("Page rename %s to %s"), $oldname, $to);
         $from = user_getemail(user_getid());
         $body = $subject . "\n" . sprintf(_("Edited by: %s"), $from) . "\n" . WikiURL($to, array(), true);
         $m = new Mail();
         $m->setFrom($from);
         $m->setSubject("[" . WIKI_NAME . "] " . $subject);
         $m->setBcc(join(',', $emails));
         $m->setBody($body);
         if ($m->send()) {
             trigger_error(sprintf(_("PageChange Notification of %s sent to %s"), $oldname, join(',', $userids)), E_USER_NOTICE);
         } else {
             trigger_error(sprintf(_("PageChange Notification Error: Couldn't send %s to %s"), $oldname, join(',', $userids)), E_USER_WARNING);
         }
     }
 }
开发者ID:nterray,项目名称:tuleap,代码行数:25,代码来源:WikiDB.php

示例12: notify

 /**
  * Notify people that listen to the status of the event
  */
 public function notify()
 {
     $dao = new SystemEventsFollowersDao(CodendiDataAccess::instance());
     $listeners = array();
     foreach ($dao->searchByType($this->getStatus()) as $row) {
         $listeners = array_merge($listeners, explode(',', $row['emails']));
     }
     if (count($listeners)) {
         $listeners = array_unique($listeners);
         $m = new Mail();
         $m->setFrom($GLOBALS['sys_noreply']);
         $m->setTo(implode(',', $listeners));
         $m->setSubject('[' . $this->getstatus() . '] ' . $this->getType());
         $m->setBody("\nEvent:        #{$this->getId()}\nType:         {$this->getType()}\nParameters:   {$this->verbalizeParameters(false)}\nPriority:     {$this->getPriority()}\nStatus:       {$this->getStatus()}\nLog:          {$this->getLog()}\nCreate Date:  {$this->getCreateDate()}\nProcess Date: {$this->getProcessDate()}\nEnd Date:     {$this->getEndDate()}\n---------------\n<" . get_server_url() . "/admin/system_events/>\n");
         $m->send();
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:20,代码来源:SystemEvent.class.php

示例13: handleNotification

 /**
  * Send the notification mail, about an event
  *
  * @return boolean
  */
 function handleNotification()
 {
     global $art_field_fact;
     $logger = new TrackerDateReminder_Logger_Prefix($this->logger, '[handleNotification]');
     $logger->info("Start");
     $group = ProjectManager::instance()->getProject($this->getGroupId());
     $at = new ArtifactType($group, $this->getGroupArtifactId());
     $art_field_fact = new ArtifactFieldFactory($at);
     $field = $art_field_fact->getFieldFromId($this->getFieldId());
     $art = new Artifact($at, $this->getArtifactId(), false);
     $logger->info("tracker: " . $this->getGroupArtifactId());
     $logger->info("artifact: " . $this->getArtifactId());
     $sent = true;
     $week = date("W", $this->getDateValue());
     $mail = new Mail();
     $mail->setFrom($GLOBALS['sys_noreply']);
     $mail->setSubject("[" . $this->getTrackerName() . "] " . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'reminder_mail_subject', array($field->getLabel(), date("j F Y", $this->getDateValue()), $art->getSummary())));
     $body = "\n" . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'reminder_mail_body_header', array($field->getLabel(), date("l j F Y", $this->getDateValue()), $week)) . "\n\n" . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'reminder_mail_body_project', array($group->getPublicName())) . "\n" . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'reminder_mail_body_tracker', array($this->getTrackerName())) . "\n" . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'reminder_mail_body_art', array($art->getSummary())) . "\n" . $field->getLabel() . ": " . date("D j F Y", $this->getDateValue()) . "\n\n" . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'reminder_mail_body_art_link') . "\n" . get_server_url() . "/tracker/?func=detail&aid=" . $this->getArtifactId() . "&atid=" . $this->getGroupArtifactId() . "&group_id=" . $this->getGroupId() . "\n\n______________________________________________________________________" . "\n" . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'reminder_mail_footer') . "\n";
     $mail->setBody($body);
     $allNotified = $this->getNotifiedPeople();
     $logger->info("notify: " . implode(', ', $allNotified));
     foreach ($allNotified as $notified) {
         $mail->setTo($notified);
         if (!$mail->send()) {
             $logger->error("faild to notify {$notified}");
             $sent = false;
         }
     }
     $logger->info("End");
     return $sent;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:36,代码来源:ArtifactDateReminderFactory.class.php

示例14: plugin_forumml_process_mail

function plugin_forumml_process_mail($plug, $reply = false)
{
    $request =& HTTPRequest::instance();
    $hp =& ForumML_HTMLPurifier::instance();
    // Instantiate a new Mail class
    $mail = new Mail();
    // Build mail headers
    $to = mail_get_listname_from_list_id($request->get('list')) . "@" . $GLOBALS['sys_lists_host'];
    $mail->setTo($to);
    $from = user_getrealname(user_getid()) . " <" . user_getemail(user_getid()) . ">";
    $mail->setFrom($from);
    $vMsg = new Valid_Text('message');
    if ($request->valid($vMsg)) {
        $message = $request->get('message');
    }
    $subject = $request->get('subject');
    $mail->setSubject($subject);
    if ($reply) {
        // set In-Reply-To header
        $hres = plugin_forumml_get_message_headers($request->get('reply_to'));
        $reply_to = db_result($hres, 0, 'value');
        $mail->addAdditionalHeader("In-Reply-To", $reply_to);
    }
    $continue = true;
    if ($request->validArray(new Valid_Email('ccs')) && $request->exist('ccs')) {
        $cc_array = array();
        $idx = 0;
        foreach ($request->get('ccs') as $cc) {
            if (trim($cc) != "") {
                $cc_array[$idx] = $hp->purify($cc, CODENDI_PURIFIER_FULL);
                $idx++;
            }
        }
        // Checks sanity of CC List
        $err = '';
        if (!util_validateCCList($cc_array, $err)) {
            $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_forumml', 'invalid_mail', $err));
            $continue = false;
        } else {
            // add list of cc users to mail mime
            if (count($cc_array) > 0) {
                $cc_list = util_normalize_emails(implode(',', $cc_array));
                $mail->setCc($cc_list, true);
            }
        }
    }
    if ($continue) {
        // Process attachments
        // Define boundaries as specified in RFC:
        // http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
        $boundary = '----=_NextPart';
        $boundaryStart = '--' . $boundary;
        $boundaryEnd = '--' . $boundary . '--';
        // Attachments headers
        if (isset($_FILES["files"]) && count($_FILES["files"]['name']) > 0) {
            $attachment = "";
            $text = "This is a multi-part message in MIME format.\n";
            $text = "{$boundaryStart}\n";
            $text .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
            $text .= "Content-Transfer-Encoding: 8bit\n\n";
            $text .= $message;
            $text .= "\n\n";
            foreach ($_FILES["files"]['name'] as $i => $fileName) {
                $attachment .= "{$boundaryStart}\n";
                $attachment .= "Content-Type:" . $_FILES["files"]["type"][$i] . "; name=" . $fileName . "\n";
                $attachment .= "Content-Transfer-Encoding: base64\n";
                $attachment .= "Content-Disposition: attachment; filename=" . $fileName . "\n\n";
                $attachment .= chunk_split(base64_encode(file_get_contents($_FILES["files"]["tmp_name"][$i])));
            }
            $attachment .= "\n{$boundaryEnd}\n";
            $body = $text . $attachment;
            // force MimeType to multipart/mixed as default (when instantiating new Mail object) is text/plain
            $mail->setMimeType('multipart/mixed; boundary="' . $boundary . '"');
            $mail->addAdditionalHeader("MIME-Version", "1.0");
        } else {
            $body = $message;
        }
        $mail->setBody($body);
        if ($mail->send()) {
            $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_forumml', 'mail_succeed'));
        } else {
            $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_forumml', 'mail_fail'));
            $continue = false;
        }
    }
    return $continue;
}
开发者ID:nterray,项目名称:tuleap,代码行数:87,代码来源:forumml_utils.php

示例15: sendAuthorQuery

 /**
  * Send an author query based on the posted data.
  * @param $args array
  * @param $request PKPRequest
  * @return string a serialized JSON message
  */
 function sendAuthorQuery(&$args, &$request)
 {
     // Instantiate the email to the author.
     import('lib.pkp.classes.mail.Mail');
     $mail = new Mail();
     // Sender
     $user =& $request->getUser();
     $mail->setFrom($user->getEmail(), $user->getFullName());
     // Recipient
     $assocObject =& $this->getAssocObject();
     $author =& $assocObject->getUser();
     $mail->addRecipient($author->getEmail(), $author->getFullName());
     // The message
     $mail->setSubject(strip_tags($request->getUserVar('authorQuerySubject')));
     $mail->setBody(strip_tags($request->getUserVar('authorQueryBody')));
     $mail->send();
     // In principle we should use a template here but this seems exaggerated
     // for such a small message.
     $json = new JSONMessage(true, '<div id="authorQueryResult"><span class="pkp_form_error">' . __('submission.citations.editor.details.sendAuthorQuerySuccess') . '</span></div>');
     return $json->getString();
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:27,代码来源:PKPCitationGridHandler.inc.php


注:本文中的Mail::setBody方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。