Ignore:
Timestamp:
2013/05/02 18:11:36 (11 years ago)
Author:
h_yoshimoto
Message:

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_SendMail.php

    r22567 r22796  
    2323 
    2424// テキスト/HTML メール送信 
    25 class SC_SendMail  
    26 { 
     25class SC_SendMail { 
    2726 
    2827    var $to;            // 送信先 
     
    4039     * @return void 
    4140     */ 
    42     function __construct() 
    43     { 
     41    function __construct() { 
    4442        $this->arrRecip = array(); 
    4543        $this->to = ''; 
     
    6462 
    6563    // 送信先の設定 
    66     function setRecip($key, $recipient) 
    67     { 
     64    function setRecip($key, $recipient) { 
    6865        $this->arrRecip[$key] = $recipient; 
    6966    } 
    7067 
    7168    // 宛先の設定 
    72     function setTo($to, $to_name = '') 
    73     { 
     69    function setTo($to, $to_name = '') { 
    7470        if ($to != '') { 
    7571            $this->to = $this->getNameAddress($to_name, $to); 
     
    7975 
    8076    // 送信元の設定 
    81     function setFrom($from, $from_name = '') 
    82     { 
     77    function setFrom($from, $from_name = '') { 
    8378        $this->from = $this->getNameAddress($from_name, $from); 
    8479    } 
    8580 
    8681    // CCの設定 
    87     function setCc($cc, $cc_name = '') 
    88     { 
     82    function setCc($cc, $cc_name = '') { 
    8983        if ($cc != '') { 
    9084            $this->cc = $this->getNameAddress($cc_name, $cc); 
     
    9488 
    9589    // BCCの設定 
    96     function setBCc($bcc) 
    97     { 
     90    function setBCc($bcc) { 
    9891        if ($bcc != '') { 
    9992            $this->bcc = $bcc; 
     
    10396 
    10497    // Reply-Toの設定 
    105     function setReplyTo($reply_to) 
    106     { 
     98    function setReplyTo($reply_to) { 
    10799        if ($reply_to != '') { 
    108100            $this->reply_to = $reply_to; 
     
    111103 
    112104    // Return-Pathの設定 
    113     function setReturnPath($return_path) 
    114     { 
     105    function setReturnPath($return_path) { 
    115106        $this->return_path = $return_path; 
    116107    } 
    117108 
    118109    // 件名の設定 
    119     function setSubject($subject) 
    120     { 
     110    function setSubject($subject) { 
    121111        $this->subject = mb_encode_mimeheader($subject, 'JIS', 'B', "\n"); 
    122112        $this->subject = str_replace(array("\r\n", "\r"), "\n", $this->subject); 
     
    124114 
    125115    // 本文の設定 
    126     function setBody($body) 
    127     { 
     116    function setBody($body) { 
    128117        // iso-2022-jpだと特殊文字が?で送信されるのでJISを使用する 
    129118        $this->body = mb_convert_encoding($body, 'JIS', CHAR_CODE); 
     
    135124     * @deprecated 2.12.2 (#1912) 
    136125     */ 
    137     function setHost($host) 
    138     { 
     126    function setHost($host) { 
    139127        trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); 
    140128        $this->host = $host; 
     
    153141     * @deprecated 2.12.2 (#1912) 
    154142     */ 
    155     function setPort($port) 
    156     { 
     143    function setPort($port) { 
    157144        trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); 
    158145        $this->port = $port; 
     
    166153 
    167154    // 名前<メールアドレス>の形式を生成 
    168     function getNameAddress($name, $mail_address) 
    169     { 
     155    function getNameAddress($name, $mail_address) { 
    170156            if ($name != '') { 
    171157                // 制御文字を変換する。 
     
    180166    } 
    181167 
    182     function setItem($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to='', $bcc='', $cc ='') 
    183     { 
     168    function setItem($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to='', $bcc='', $cc ='') { 
    184169        $this->setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to, $bcc, $cc); 
    185170    } 
    186171 
    187     function setItemHtml($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to='', $bcc='', $cc ='') 
    188     { 
     172    function setItemHtml($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to='', $bcc='', $cc ='') { 
    189173        $this->setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to, $bcc, $cc); 
    190174    } 
     
    202186         $bcc           -> ブラインドカーボンコピー 
    203187    */ 
    204     function setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to='', $bcc='', $cc ='') 
    205     { 
     188    function setBase($to, $subject, $body, $fromaddress, $from_name, $reply_to='', $return_path='', $errors_to='', $bcc='', $cc ='') { 
    206189        // 宛先設定 
    207190        $this->setTo($to); 
     
    230213 
    231214    // ヘッダーを返す 
    232     function getBaseHeader() 
    233     { 
     215    function getBaseHeader() { 
    234216        // 送信するメールの内容と送信先 
    235217        $arrHeader = array(); 
     
    254236 
    255237    // ヘッダーを返す 
    256     function getTEXTHeader() 
    257     { 
     238    function getTEXTHeader() { 
    258239        $arrHeader = $this->getBaseHeader(); 
    259240        $arrHeader['Content-Type'] = 'text/plain; charset="ISO-2022-JP"'; 
     
    262243 
    263244    // ヘッダーを返す 
    264     function getHTMLHeader() 
    265     { 
     245    function getHTMLHeader() { 
    266246        $arrHeader = $this->getBaseHeader(); 
    267247        $arrHeader['Content-Type'] = 'text/html; charset="ISO-2022-JP"'; 
     
    274254     * @return array|string メーラーバックエンドに応じた送信先 
    275255     */ 
    276     function getRecip() 
    277     { 
     256    function getRecip() { 
    278257        switch ($this->backend) { 
    279258            // PEAR::Mail_mail#send は、(他のメーラーバックエンドと異なり) 第1引数を To: として扱う。Cc: や Bcc: は、ヘッダー情報から処理する。 
     
    295274     * @return void 
    296275     */ 
    297     function sendMail($isHtml = false) 
    298     { 
     276    function sendMail($isHtml = false) { 
    299277        $header = $isHtml ? $this->getHTMLHeader() : $this->getTEXTHeader(); 
    300278        $recip = $this->getRecip(); 
     
    317295     * @return void 
    318296     */ 
    319     function sendHtmlMail() 
    320     { 
     297    function sendHtmlMail() { 
    321298        return $this->sendMail(true); 
    322299    } 
     
    328305     * @return array メーラーバックエンドに応じたパラメーターの配列 
    329306     */ 
    330     function getBackendParams($backend) 
    331     { 
     307    function getBackendParams($backend) { 
    332308        switch ($backend) { 
    333309            case 'mail': 
Note: See TracChangeset for help on using the changeset viewer.