TYPO3 API  SVNRelease
Message.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This file is part of SwiftMailer.
00005  * (c) 2004-2009 Chris Corbyn
00006  *
00007  * For the full copyright and license information, please view the LICENSE
00008  * file that was distributed with this source code.
00009  */
00010 
00011 //@require 'Swift/Mime/MimeEntity.php';
00012 
00013 /**
00014  * A Message (RFC 2822) object.
00015  *
00016  * @package Swift
00017  * @subpackage Mime
00018  *
00019  * @author Chris Corbyn
00020  */
00021 interface Swift_Mime_Message extends Swift_Mime_MimeEntity
00022 {
00023 
00024   /**
00025    * Generates a valid Message-ID and switches to it.
00026    *
00027    * @return string
00028    */
00029   public function generateId();
00030 
00031   /**
00032    * Set the subject of the message.
00033    *
00034    * @param string $subject
00035    */
00036   public function setSubject($subject);
00037 
00038   /**
00039    * Get the subject of the message.
00040    *
00041    * @return string
00042    */
00043   public function getSubject();
00044 
00045   /**
00046    * Set the origination date of the message as a UNIX timestamp.
00047    *
00048    * @param int $date
00049    */
00050   public function setDate($date);
00051 
00052   /**
00053    * Get the origination date of the message as a UNIX timestamp.
00054    *
00055    * @return int
00056    */
00057   public function getDate();
00058 
00059   /**
00060    * Set the return-path (bounce-detect) address.
00061    *
00062    * @param string $address
00063    */
00064   public function setReturnPath($address);
00065 
00066   /**
00067    * Get the return-path (bounce-detect) address.
00068    *
00069    * @return string
00070    */
00071   public function getReturnPath();
00072 
00073   /**
00074    * Set the sender of this message.
00075    *
00076    * If multiple addresses are present in the From field, this SHOULD be set.
00077    *
00078    * According to RFC 2822 it is a requirement when there are multiple From
00079    * addresses, but Swift itself does not require it directly.
00080    *
00081    * An associative array (with one element!) can be used to provide a display-
00082    * name: i.e. array('email@address' => 'Real Name').
00083    *
00084    * If the second parameter is provided and the first is a string, then $name
00085    * is associated with the address.
00086    *
00087    * @param mixed $address
00088    * @param string $name optional
00089    */
00090   public function setSender($address, $name = null);
00091 
00092   /**
00093    * Get the sender address for this message.
00094    *
00095    * This has a higher significance than the From address.
00096    *
00097    * @return string
00098    */
00099   public function getSender();
00100 
00101   /**
00102    * Set the From address of this message.
00103    *
00104    * It is permissible for multiple From addresses to be set using an array.
00105    *
00106    * If multiple From addresses are used, you SHOULD set the Sender address and
00107    * according to RFC 2822, MUST set the sender address.
00108    *
00109    * An array can be used if display names are to be provided: i.e.
00110    * array('email@address.com' => 'Real Name').
00111    *
00112    * If the second parameter is provided and the first is a string, then $name
00113    * is associated with the address.
00114    *
00115    * @param mixed $addresses
00116    * @param string $name optional
00117    */
00118   public function setFrom($addresses, $name = null);
00119 
00120   /**
00121    * Get the From address(es) of this message.
00122    *
00123    * This method always returns an associative array where the keys are the
00124    * addresses.
00125    *
00126    * @return string[]
00127    */
00128   public function getFrom();
00129 
00130   /**
00131    * Set the Reply-To address(es).
00132    *
00133    * Any replies from the receiver will be sent to this address.
00134    *
00135    * It is permissible for multiple reply-to addresses to be set using an array.
00136    *
00137    * This method has the same synopsis as {@link setFrom()} and {@link setTo()}.
00138    *
00139    * If the second parameter is provided and the first is a string, then $name
00140    * is associated with the address.
00141    *
00142    * @param mixed $addresses
00143    * @param string $name optional
00144    */
00145   public function setReplyTo($addresses, $name = null);
00146 
00147   /**
00148    * Get the Reply-To addresses for this message.
00149    *
00150    * This method always returns an associative array where the keys provide the
00151    * email addresses.
00152    *
00153    * @return string[]
00154    */
00155   public function getReplyTo();
00156 
00157   /**
00158    * Set the To address(es).
00159    *
00160    * Recipients set in this field will receive a copy of this message.
00161    *
00162    * This method has the same synopsis as {@link setFrom()} and {@link setCc()}.
00163    *
00164    * If the second parameter is provided and the first is a string, then $name
00165    * is associated with the address.
00166    *
00167    * @param mixed $addresses
00168    * @param string $name optional
00169    */
00170   public function setTo($addresses, $name = null);
00171 
00172   /**
00173    * Get the To addresses for this message.
00174    *
00175    * This method always returns an associative array, whereby the keys provide
00176    * the actual email addresses.
00177    *
00178    * @return string[]
00179    */
00180   public function getTo();
00181 
00182   /**
00183    * Set the Cc address(es).
00184    *
00185    * Recipients set in this field will receive a 'carbon-copy' of this message.
00186    *
00187    * This method has the same synopsis as {@link setFrom()} and {@link setTo()}.
00188    *
00189    * @param mixed $addresses
00190    * @param string $name optional
00191    */
00192   public function setCc($addresses, $name = null);
00193 
00194   /**
00195    * Get the Cc addresses for this message.
00196    *
00197    * This method always returns an associative array, whereby the keys provide
00198    * the actual email addresses.
00199    *
00200    * @return string[]
00201    */
00202   public function getCc();
00203 
00204   /**
00205    * Set the Bcc address(es).
00206    *
00207    * Recipients set in this field will receive a 'blind-carbon-copy' of this
00208    * message.
00209    *
00210    * In other words, they will get the message, but any other recipients of the
00211    * message will have no such knowledge of their receipt of it.
00212    *
00213    * This method has the same synopsis as {@link setFrom()} and {@link setTo()}.
00214    *
00215    * @param mixed $addresses
00216    * @param string $name optional
00217    */
00218   public function setBcc($addresses, $name = null);
00219 
00220   /**
00221    * Get the Bcc addresses for this message.
00222    *
00223    * This method always returns an associative array, whereby the keys provide
00224    * the actual email addresses.
00225    *
00226    * @return string[]
00227    */
00228   public function getBcc();
00229 
00230 }