Changeset 16321


Ignore:
Timestamp:
2007/10/07 17:32:40 (16 years ago)
Author:
naka
Message:

メルマガ配信機能

Location:
branches/feature-module-update
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/GC_SendMail.php

    r16303 r16321  
    3939        $this->objMailMime = new Mail_mime(); 
    4040        mb_language( "Japanese" ); 
    41         $this->arrTEXTEncode['text_charset'] = "ISO-2022-JP"; 
    42         $this->arrHTMLEncode['head_charset'] = "ISO-2022-JP"; 
    43         $this->arrHTMLEncode['html_encoding'] = "ISO-2022-JP"; 
    44         $this->arrHTMLEncode['html_charset'] = "ISO-2022-JP"; 
    4541        $arrHost = array(    
    4642                'host' => $this->host, 
     
    186182     
    187183    // ヘッダーを返す 
    188     function getHeader() { 
     184    function getBaseHeader() { 
    189185        //-- 送信するメールの内容と送信先 
     186        $arrHeader['MIME-Version'] = '1.0'; 
    190187        $arrHeader['To'] = $this->to; 
    191188        $arrHeader['Subject'] = $this->subject; 
     
    207204    } 
    208205     
     206    // ヘッダーを返す 
     207    function getTEXTHeader() { 
     208        $arrHeader = $this->getBaseHeader(); 
     209        $arrHeader['Content-Type'] = "text/plain; charset=\"ISO-2022-JP\""; 
     210        $arrHeader['Content-Transfer-Encoding'] = "7bit";    
     211        return $arrHeader; 
     212    } 
     213     
     214    // ヘッダーを返す 
     215    function getHTMLHeader() { 
     216        $arrHeader = $this->getBaseHeader(); 
     217        $arrHeader['Content-Type'] = "text/html; charset=\"ISO-2022-JP\""; 
     218        $arrHeader['Content-Transfer-Encoding'] = "ISO-2022-JP";     
     219        return $arrHeader; 
     220    } 
     221     
    209222    //  TXTメール送信を実行する 
    210223    function sendMail() { 
    211         $this->objMailMime->setTXTBody($this->body); 
    212         $body = $this->objMailMime->get($this->arrTEXTEncode); 
    213         $header = $this->getHeader(); 
     224        $header = $this->getTEXTHeader(); 
    214225        // メール送信 
    215         $result = $this->objMail->send($this->to, $header, $body);            
     226        $result = $this->objMail->send($this->to, $header, $this->body);            
    216227        if (PEAR::isError($result)) {  
    217228            GC_Utils_Ex::gfPrintLog($result->getMessage()); 
     
    219230            return false;        
    220231        } 
    221         return true;         
     232        return true; 
    222233    } 
    223234     
    224235    // HTMLメール送信を実行する 
    225236    function sendHtmlMail() { 
    226         $this->objMailMime->setHTMLBody($this->body); 
    227         $body = $this->objMailMime->get($this->arrHTMLEncode); 
    228         $header = $this->getHeader(); 
     237        $header = $this->getHTMLHeader(); 
    229238        // メール送信 
    230         $result = $this->objMail->send($this->to, $header, $body);            
     239        $result = $this->objMail->send($this->to, $header, $this->body);            
    231240        if (PEAR::isError($result)) {  
    232241            GC_Utils_Ex::gfPrintLog($result->getMessage()); 
  • branches/feature-module-update/html/test/naka/mail.php

    r16308 r16321  
    88            //-- 送信するメールの内容と送信先 
    99            $sendResut = array(  
    10                 "to" => 'abnana210@softbank.ne.jp',             // 顧客宛先  
     10                "to" => 'naka@lockon.co.jp',            // 顧客宛先  
    1111                "Subject" => mb_encode_mimeheader("てすと"),   // Subject   
    1212                "From" => 'test01@lockon.co.jp',                // 送信元メールアドレス 
Note: See TracChangeset for help on using the changeset viewer.