~ubuntu-branches/ubuntu/trusty/zendframework/trusty

« back to all changes in this revision

Viewing changes to library/Zend/Mail.php

  • Committer: Bazaar Package Importer
  • Author(s): Frank Habermann
  • Date: 2010-04-28 20:10:00 UTC
  • mfrom: (1.3.1 upstream) (9.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100428201000-o347bj5qb5i3tpot
Tags: 1.10.4-1
new upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * @package    Zend_Mail
17
17
 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18
18
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
19
 
 * @version    $Id: Mail.php 20096 2010-01-06 02:05:09Z bkarwin $
 
19
 * @version    $Id: Mail.php 20783 2010-01-31 08:06:30Z yoshida@zend.co.jp $
20
20
 */
21
21
 
22
22
 
64
64
    /**
65
65
     * @var array
66
66
     * @static
67
 
     */    
 
67
     */
68
68
    protected static $_defaultFrom;
69
69
 
70
70
    /**
71
71
     * @var array
72
72
     * @static
73
 
     */ 
 
73
     */
74
74
    protected static $_defaultReplyTo;
75
 
    
 
75
 
76
76
    /**
77
77
     * Mail character set
78
78
     * @var string
184
184
    {
185
185
        self::$_defaultTransport = $transport;
186
186
    }
187
 
    
 
187
 
188
188
    /**
189
189
     * Gets the default mail transport for all following uses of
190
190
     * unittests
196
196
    {
197
197
        return self::$_defaultTransport;
198
198
    }
199
 
    
 
199
 
200
200
    /**
201
201
     * Clear the default transport property
202
202
     */
758
758
 
759
759
    /**
760
760
     * Returns the default sender of the mail
761
 
     * 
 
761
     *
762
762
     * @return null|array   Null if none was set.
763
763
     */
764
764
    public static function getDefaultFrom()
768
768
 
769
769
    /**
770
770
     * Clears the default sender from the mail
771
 
     * 
 
771
     *
772
772
     * @return void
773
773
     */
774
774
    public static function clearDefaultFrom()
775
775
    {
776
776
        self::$_defaultFrom = null;
777
777
    }
778
 
    
 
778
 
779
779
    /**
780
780
     * Sets From-name and -email based on the defaults
781
 
     * 
 
781
     *
782
782
     * @return Zend_Mail Provides fluent interface
783
783
     */
784
784
    public function setFromToDefaultFrom() {
788
788
            throw new Zend_Mail_Exception(
789
789
                'No default From Address set to use');
790
790
        }
791
 
        
 
791
 
792
792
        $this->setFrom($from['email'], $from['name']);
793
793
 
794
794
        return $this;
795
795
    }
796
 
    
 
796
 
797
797
    /**
798
798
     * Sets Default ReplyTo-address and -name of the message
799
799
     *
805
805
    {
806
806
        self::$_defaultReplyTo = array('email' => $email, 'name' => $name);
807
807
    }
808
 
    
 
808
 
809
809
    /**
810
810
     * Returns the default Reply-To Address and Name of the mail
811
 
     * 
 
811
     *
812
812
     * @return null|array   Null if none was set.
813
813
     */
814
814
    public static function getDefaultReplyTo()
815
815
    {
816
816
        return self::$_defaultReplyTo;
817
817
    }
818
 
    
 
818
 
819
819
    /**
820
820
     * Clears the default ReplyTo-address and -name from the mail
821
 
     * 
 
821
     *
822
822
     * @return void
823
823
     */
824
824
    public static function clearDefaultReplyTo()
828
828
 
829
829
    /**
830
830
     * Sets ReplyTo-name and -email based on the defaults
831
 
     * 
 
831
     *
832
832
     * @return Zend_Mail Provides fluent interface
833
833
     */
834
834
    public function setReplyToFromDefault() {
838
838
            throw new Zend_Mail_Exception(
839
839
                'No default Reply-To Address set to use');
840
840
        }
841
 
        
 
841
 
842
842
        $this->setReplyTo($replyTo['email'], $replyTo['name']);
843
843
 
844
844
        return $this;
1019
1019
     * true  :Auto
1020
1020
     * false :No set
1021
1021
     * null  :No set
1022
 
     * string:Sets given string
 
1022
     * string:Sets given string (Angle brackets is not necessary)
1023
1023
     * @return  Zend_Mail Provides fluent interface
1024
1024
     * @throws  Zend_Mail_Exception
1025
1025
     */
1034
1034
        if ($this->_messageId === null) {
1035
1035
            $id = $this->_filterOther($id);
1036
1036
            $this->_messageId = $id;
1037
 
            $this->_storeHeader('Message-Id', $this->_messageId);
 
1037
            $this->_storeHeader('Message-Id', '<' . $this->_messageId . '>');
1038
1038
        } else {
1039
1039
            /**
1040
1040
             * @see Zend_Mail_Exception