Changeset 16303


Ignore:
Timestamp:
2007/10/06 21:43:42 (16 years ago)
Author:
naka
Message:

GC_SendMailメソッド追加

File:
1 edited

Legend:

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

    r16302 r16303  
    5656    } 
    5757     
     58    // 送信元の設定 
     59    function setFrom($from, $from_name = "") { 
     60        $this->from = $this->getNameAddress($from_name, $from); 
     61    } 
     62     
     63    // CCの設定 
     64    function setCc($cc, $cc_name = "") { 
     65        if($cc != "") { 
     66            $this->cc = $this->getNameAddress($cc_name, $cc); 
     67        } 
     68    } 
     69     
     70    // BCCの設定 
     71    function setBCc($bcc) { 
     72        if($bcc != "") { 
     73            $this->bcc = $bcc; 
     74        } 
     75    } 
     76     
     77    // Reply-Toの設定 
     78    function setReplyTo($reply_to) { 
     79        if($reply_to != "") { 
     80            $this->reply_to = $reply_to;             
     81        }        
     82    } 
     83     
     84    // Return-Pathの設定 
     85    function setReturnPath($return_path) { 
     86        $this->return_path = $return_path; 
     87    }    
     88     
     89    // 件名の設定 
     90    function setSubject($subject) { 
     91        $this->subject = mb_encode_mimeheader($subject); 
     92    } 
     93     
     94    // 本文の設定 
     95    function setBody($body) { 
     96        $this->body = mb_convert_encoding($body, "JIS", CHAR_CODE); 
     97    } 
     98     
    5899    // SMTPサーバの設定 
    59100    function setHost($host) { 
     
    120161    function setBase( $to, $subject, $body, $fromaddress, $from_name, $reply_to="", $return_path="", $errors_to="", $bcc="", $cc ="" ) { 
    121162        // 宛先設定 
    122         $this->to            = $to; 
     163        $this->to = $to;     
    123164        // 件名設定 
    124         $this->subject       = mb_encode_mimeheader($subject); 
     165        $this->setSubject($subject); 
    125166        // 本文設定(iso-2022-jpだと特殊文字が?で送信されるのでJISを使用する) 
    126         $this->body          = mb_convert_encoding( $body, "JIS", CHAR_CODE); 
     167        $this->setBody($body); 
    127168        // 送信元設定 
    128         $this->from = $this->getNameAddress($from_name, $fromaddress); 
     169        $this->setFrom($fromaddress, $from_name); 
    129170        // 返信先設定 
    130         if($reply_to != "") { 
    131             $this->reply_to = $reply_to;             
    132         }        
     171        $this->setReplyTo($reply_to); 
    133172        // CC設定 
    134         if($cc != "") { 
    135             $this->cc = $cc;     
    136         } 
     173        $this->setCc($cc); 
    137174        // BCC設定 
    138         if($bcc != "") { 
    139             $this->bcc = $bcc;           
    140         } 
     175        $this->setBcc($bcc); 
     176         
    141177        // Errors-Toは、ほとんどのSMTPで無視され、Return-Pathが優先されるためReturn_Pathに設定する。 
    142178        if($errors_to != "") { 
     
    158194         
    159195        if($this->reply_to != "") { 
    160             $arrHeader['Reply'] = $this->reply_to; 
     196            $arrHeader['Reply-To'] = $this->reply_to; 
    161197        } 
    162198         
Note: See TracChangeset for help on using the changeset viewer.