Email->settings(array( 'from' => 'Me ', 'template' => 'test' )); } /** * Send just one email * */ function sendMeAnEmail() { return $this->Email->send(array( 'to' => 'some@mail.com', 'subject' => 'Talking to myself' )); } /** * Send multiple emails, change a few variables on the fly * and test that we can 'set' variables to the view * */ function sendMyFriendsAnEmail() { $myFriends = array('fake@mail.com', 'fake@mail.box', 'fake@user.com'); $this->Email->settings(array('subject' => 'Hello friends')); foreach ($myFriends AS $friend) { $this->Email->set('someVar', $friend); $this->Email->send(array( 'to' => $friend, 'subject' => 'Hello ' . $friend )); } } } ?>