コード例 #1
0
ファイル: wikibot.classes.php プロジェクト: Riamse/cluebotng
 /**
  * Sends an email to a user.
  * @param $user Username to send email to.
  * @param $subject Subject of email to send.
  * @param $body Body of email to send.
  * @return HTML content.
  **/
 function email($user, $subject, $body)
 {
     $wpapi = new wikipediaapi();
     $wpapi->apiurl = str_replace('index.php', 'api.php', $this->indexurl);
     if (!$this->edittoken or $this->edittoken == '') {
         $this->edittoken = $wpapi->getedittoken();
     }
     $post = array('wpSubject' => $subject, 'wpText' => $body, 'wpCCMe' => 0, 'wpSend' => 'Send', 'wpEditToken' => $this->edittoken);
     return $this->http->post($this->indexurl . '?title=Special:EmailUser&target=' . urlencode($user) . '&action=submit', $post);
 }