|
1 <?php |
|
2 |
|
3 /* |
|
4 * This file is part of SwiftMailer. |
|
5 * (c) 2004-2009 Chris Corbyn |
|
6 * |
|
7 * For the full copyright and license information, please view the LICENSE |
|
8 * file that was distributed with this source code. |
|
9 */ |
|
10 |
|
11 |
|
12 /** |
|
13 * A Message (RFC 2822) object. |
|
14 * |
|
15 * @package Swift |
|
16 * @subpackage Mime |
|
17 * |
|
18 * @author Chris Corbyn |
|
19 */ |
|
20 interface Swift_Mime_Message extends Swift_Mime_MimeEntity |
|
21 { |
|
22 |
|
23 /** |
|
24 * Generates a valid Message-ID and switches to it. |
|
25 * |
|
26 * @return string |
|
27 */ |
|
28 public function generateId(); |
|
29 |
|
30 /** |
|
31 * Set the subject of the message. |
|
32 * |
|
33 * @param string $subject |
|
34 */ |
|
35 public function setSubject($subject); |
|
36 |
|
37 /** |
|
38 * Get the subject of the message. |
|
39 * |
|
40 * @return string |
|
41 */ |
|
42 public function getSubject(); |
|
43 |
|
44 /** |
|
45 * Set the origination date of the message as a UNIX timestamp. |
|
46 * |
|
47 * @param int $date |
|
48 */ |
|
49 public function setDate($date); |
|
50 |
|
51 /** |
|
52 * Get the origination date of the message as a UNIX timestamp. |
|
53 * |
|
54 * @return int |
|
55 */ |
|
56 public function getDate(); |
|
57 |
|
58 /** |
|
59 * Set the return-path (bounce-detect) address. |
|
60 * |
|
61 * @param string $address |
|
62 */ |
|
63 public function setReturnPath($address); |
|
64 |
|
65 /** |
|
66 * Get the return-path (bounce-detect) address. |
|
67 * |
|
68 * @return string |
|
69 */ |
|
70 public function getReturnPath(); |
|
71 |
|
72 /** |
|
73 * Set the sender of this message. |
|
74 * |
|
75 * If multiple addresses are present in the From field, this SHOULD be set. |
|
76 * |
|
77 * According to RFC 2822 it is a requirement when there are multiple From |
|
78 * addresses, but Swift itself does not require it directly. |
|
79 * |
|
80 * An associative array (with one element!) can be used to provide a display- |
|
81 * name: i.e. array('email@address' => 'Real Name'). |
|
82 * |
|
83 * If the second parameter is provided and the first is a string, then $name |
|
84 * is associated with the address. |
|
85 * |
|
86 * @param mixed $address |
|
87 * @param string $name optional |
|
88 */ |
|
89 public function setSender($address, $name = null); |
|
90 |
|
91 /** |
|
92 * Get the sender address for this message. |
|
93 * |
|
94 * This has a higher significance than the From address. |
|
95 * |
|
96 * @return string |
|
97 */ |
|
98 public function getSender(); |
|
99 |
|
100 /** |
|
101 * Set the From address of this message. |
|
102 * |
|
103 * It is permissible for multiple From addresses to be set using an array. |
|
104 * |
|
105 * If multiple From addresses are used, you SHOULD set the Sender address and |
|
106 * according to RFC 2822, MUST set the sender address. |
|
107 * |
|
108 * An array can be used if display names are to be provided: i.e. |
|
109 * array('email@address.com' => 'Real Name'). |
|
110 * |
|
111 * If the second parameter is provided and the first is a string, then $name |
|
112 * is associated with the address. |
|
113 * |
|
114 * @param mixed $addresses |
|
115 * @param string $name optional |
|
116 */ |
|
117 public function setFrom($addresses, $name = null); |
|
118 |
|
119 /** |
|
120 * Get the From address(es) of this message. |
|
121 * |
|
122 * This method always returns an associative array where the keys are the |
|
123 * addresses. |
|
124 * |
|
125 * @return string[] |
|
126 */ |
|
127 public function getFrom(); |
|
128 |
|
129 /** |
|
130 * Set the Reply-To address(es). |
|
131 * |
|
132 * Any replies from the receiver will be sent to this address. |
|
133 * |
|
134 * It is permissible for multiple reply-to addresses to be set using an array. |
|
135 * |
|
136 * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. |
|
137 * |
|
138 * If the second parameter is provided and the first is a string, then $name |
|
139 * is associated with the address. |
|
140 * |
|
141 * @param mixed $addresses |
|
142 * @param string $name optional |
|
143 */ |
|
144 public function setReplyTo($addresses, $name = null); |
|
145 |
|
146 /** |
|
147 * Get the Reply-To addresses for this message. |
|
148 * |
|
149 * This method always returns an associative array where the keys provide the |
|
150 * email addresses. |
|
151 * |
|
152 * @return string[] |
|
153 */ |
|
154 public function getReplyTo(); |
|
155 |
|
156 /** |
|
157 * Set the To address(es). |
|
158 * |
|
159 * Recipients set in this field will receive a copy of this message. |
|
160 * |
|
161 * This method has the same synopsis as {@link setFrom()} and {@link setCc()}. |
|
162 * |
|
163 * If the second parameter is provided and the first is a string, then $name |
|
164 * is associated with the address. |
|
165 * |
|
166 * @param mixed $addresses |
|
167 * @param string $name optional |
|
168 */ |
|
169 public function setTo($addresses, $name = null); |
|
170 |
|
171 /** |
|
172 * Get the To addresses for this message. |
|
173 * |
|
174 * This method always returns an associative array, whereby the keys provide |
|
175 * the actual email addresses. |
|
176 * |
|
177 * @return string[] |
|
178 */ |
|
179 public function getTo(); |
|
180 |
|
181 /** |
|
182 * Set the Cc address(es). |
|
183 * |
|
184 * Recipients set in this field will receive a 'carbon-copy' of this message. |
|
185 * |
|
186 * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. |
|
187 * |
|
188 * @param mixed $addresses |
|
189 * @param string $name optional |
|
190 */ |
|
191 public function setCc($addresses, $name = null); |
|
192 |
|
193 /** |
|
194 * Get the Cc addresses for this message. |
|
195 * |
|
196 * This method always returns an associative array, whereby the keys provide |
|
197 * the actual email addresses. |
|
198 * |
|
199 * @return string[] |
|
200 */ |
|
201 public function getCc(); |
|
202 |
|
203 /** |
|
204 * Set the Bcc address(es). |
|
205 * |
|
206 * Recipients set in this field will receive a 'blind-carbon-copy' of this |
|
207 * message. |
|
208 * |
|
209 * In other words, they will get the message, but any other recipients of the |
|
210 * message will have no such knowledge of their receipt of it. |
|
211 * |
|
212 * This method has the same synopsis as {@link setFrom()} and {@link setTo()}. |
|
213 * |
|
214 * @param mixed $addresses |
|
215 * @param string $name optional |
|
216 */ |
|
217 public function setBcc($addresses, $name = null); |
|
218 |
|
219 /** |
|
220 * Get the Bcc addresses for this message. |
|
221 * |
|
222 * This method always returns an associative array, whereby the keys provide |
|
223 * the actual email addresses. |
|
224 * |
|
225 * @return string[] |
|
226 */ |
|
227 public function getBcc(); |
|
228 |
|
229 } |