1 | <?php |
||
29 | class Mail |
||
30 | { |
||
31 | /** |
||
32 | * the recipient of mail |
||
33 | * @access private |
||
34 | * @var array |
||
35 | */ |
||
36 | private $_aRecipient = array(); |
||
37 | |||
38 | /** |
||
39 | * the from of mail |
||
40 | * @access private |
||
41 | * @var string |
||
42 | */ |
||
43 | private $_sFrom = "[email protected]"; |
||
44 | |||
45 | /** |
||
46 | * the subject of mail |
||
47 | * @access private |
||
48 | * @var string |
||
49 | */ |
||
50 | private $_sSubject = "nosubject"; |
||
51 | |||
52 | /** |
||
53 | * the content of mail |
||
54 | * @access private |
||
55 | * @var string |
||
56 | */ |
||
57 | private $_sMessage = ""; |
||
58 | |||
59 | /** |
||
60 | * the format of mail |
||
61 | * @access private |
||
62 | * @var string |
||
63 | */ |
||
64 | private $_sFormat = "TXT"; // valeur : TXT ou HTML; |
||
65 | |||
66 | /** |
||
67 | * file to send with mail |
||
68 | * @access private |
||
69 | * @var array |
||
70 | */ |
||
71 | private $_aAttachments = array(); |
||
72 | |||
73 | /** |
||
74 | * add a recipient of mail |
||
75 | * |
||
76 | * @access public private |
||
77 | * @param string $sRecipient |
||
78 | * @return Mail |
||
79 | */ |
||
80 | public function addRecipient(string $sRecipient) : Mail |
||
85 | |||
86 | /** |
||
87 | * add a file to the mail |
||
88 | * |
||
89 | * @access public private |
||
90 | * @param string $sFileName |
||
91 | * @param string $sContent |
||
92 | * @param string $sType |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function attachFile(string $sFileName, string $sContent, string $sType) : bool |
||
105 | |||
106 | /** |
||
107 | * set the from of mail |
||
108 | * |
||
109 | * @access public private |
||
110 | * @param string $sFrom |
||
111 | * @return Mail |
||
112 | */ |
||
113 | public function setFrom(string $sFrom) : Mail |
||
118 | |||
119 | /** |
||
120 | * set the subjet of mail |
||
121 | * |
||
122 | * @access public private |
||
123 | * @param string $sSubject |
||
124 | * @return Mail |
||
125 | */ |
||
126 | public function setSubject(string $sSubject) : Mail |
||
131 | |||
132 | /** |
||
133 | * set the message of mail |
||
134 | * |
||
135 | * @access public private |
||
136 | * @param string $sMessage |
||
137 | * @return Mail |
||
138 | */ |
||
139 | public function setMessage(string $sMessage) : Mail |
||
144 | |||
145 | /** |
||
146 | * set the format HTML of mail |
||
147 | * |
||
148 | * @access public private |
||
149 | * @return Mail |
||
150 | */ |
||
151 | public function setFormatHtml() : Mail |
||
156 | |||
157 | /** |
||
158 | * set the format HTML of mail |
||
159 | * |
||
160 | * @access public private |
||
161 | * @return Mail |
||
162 | */ |
||
163 | public function setFormatText() : Mail |
||
168 | |||
169 | /** |
||
170 | * send the mail |
||
171 | * |
||
172 | * @access public private |
||
173 | * @return bool |
||
174 | */ |
||
175 | public function send() : bool |
||
209 | } |
||
210 |