no problem with the email function : last week it works fine

$components=array( 'Email');

sure I write it, to there is the error:

Fatal error: Call to undefined function: send() in
/usersdev/wii/web/html/check/app/controllers/applications_controller.php
on line 17

and the controller:
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->controller = $this;
$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{
        var $tpl;
        var $to = null;
        var $from = null;
        var $subject = null;
        var $cc = null;
        var $bcc = null;
        var $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;
        }
}


Thanks again


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to