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