[pLog-svn] r5828 - plog/branches/lifetype-1.2/class/mail

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Aug 15 15:55:46 EDT 2007


Author: oscar
Date: 2007-08-15 15:55:46 -0400 (Wed, 15 Aug 2007)
New Revision: 5828

Modified:
   plog/branches/lifetype-1.2/class/mail/emailmessage.class.php
Log:
Implemented setTo, setCc and setBcc, which as opposed to addTo, addCc and addBcc, reset the current list of destination adddresses and add the given one as the only one.


Modified: plog/branches/lifetype-1.2/class/mail/emailmessage.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/mail/emailmessage.class.php	2007-08-15 19:54:57 UTC (rev 5827)
+++ plog/branches/lifetype-1.2/class/mail/emailmessage.class.php	2007-08-15 19:55:46 UTC (rev 5828)
@@ -50,6 +50,17 @@
         	array_push( $this->_toAddrs, rtrim($to) );
         }
 
+		/**
+		 * Resets the current list of destinations and adds this new one as the only one. 
+		 *
+         * @param to Destination address.
+		 */
+		function setTo( $to )
+		{
+			$this->_toAddrs = Array();
+			$this->addTo( $to );
+		}
+
         /**
          * Adds a Cc:
          *
@@ -60,6 +71,17 @@
         	array_push( $this->_ccAddrs, rtrim($cc) );
         }
 
+		/**
+		 * Resets the current list of Cc destinations and adds this new one as the only one. 
+		 *
+         * @param to Destination address.
+		 */
+		function setCc( $to )
+		{
+			$this->_ccAddrs = Array();
+			$this->addCc( $to );
+		}
+
         /**
          * Adds a Bcc address
          *
@@ -70,6 +92,17 @@
         	array_push( $this->_bccAddrs, rtrim($bcc) );
         }
 
+		/**
+		 * Resets the current list of Bcc destinations and adds this new one as the only one. 
+		 *
+         * @param to Destination address.
+		 */
+		function setBcc( $to )
+		{
+			$this->_bccAddrs = Array();
+			$this->addBcc( $to );
+		}
+
         /**
          * Sets the from address
          *



More information about the pLog-svn mailing list