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