Try changing controller & component to this:
class ApplicationsController extends AppController
{
//var $scaffold;
var $name = 'Applications';
var $components=array('Email');
function index(){
$some_data_for_email='test';
$this->set('var_to_email',$some_data_for_email);
$this->Email->tpl = 'email_to_send';//name of thtml to include
$this->Email->to = '[EMAIL PROTECTED]';
$this->Email->from = '[EMAIL PROTECTED]';
$this->Email->cc = '[EMAIL PROTECTED]';
$this->Email->bcc = '[EMAIL PROTECTED]';
$this->Email->subject = 'the subject';
if(!$this->Email->send())
and the component:
class EmailComponent extends Object{
var $tpl;
var $to = null;
var $from = null;
var $subject = null;
var $cc = null;
var $bcc = null;
var $controller;
function startup(&$controller)
{
$this->controller=& $controller;
}
function message(){
ob_start();
$this->controller->render($this->tpl,'email');
$mail = ob_get_clean();
return $mail;
}
function send(){
$headers = "Content-type: text/html;
charset=iso-8859-1\n"
."Content-Transfer-Encoding:
quoted-printable\n"
."From: $this->from\n"
."Return-Path: $this->from\n"
."CC:$this->cc\n"
."BCC:$this->bcc\n";
$success = mail($this->to, $this->subject,
$this->message(),
$headers);
return $success;
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---