Did you create an email configuration file? 

app/Config/email.php

There is a default one at: app/Config/email.php.default 

Cheers,
Graham Weldon


On Monday, 24 October 2011 at 2:33 PM, fly2279 wrote: 
> I'm trying to figure out how to use the new CakeEmail class in cakephp
> 2.0. I've used the cookbook to configure everything and just try to
> send a simple test email but I keep getting an internal server error.
> 
> Here's the code I'm using to send a basic email:
> 
> $email = new CakeEmail();
> debug($email->from('kennethf...@gmail.com (mailto:kennethf...@gmail.com)')-
> > to('kennethf...@gmail.com 
> > (mailto:kennethf...@gmail.com)')->subject('Welcome')->send('Hello! This is
> my message to the new user.'));
> 
> 
> All I seem to be able to get is an internal server error with the
> following stack trace:
> 
> #0 C:\xampp\cake-2.0\lib\Cake\Network\Email\CakeEmail.php(959):
> MailTransport->send(Object(CakeEmail))
> #1 C:\xampp\cakeapps\app\Controller\UsersController.php(222):
> CakeEmail->send('Hello! This is ...')
> #2 [internal function]: UsersController->admin_email()
> #3 C:\xampp\cake-2.0\lib\Cake\Controller\Controller.php(473):
> ReflectionMethod->invokeArgs(Object(UsersController), Array)
> #4 C:\xampp\cake-2.0\lib\Cake\Routing\Dispatcher.php(107): Controller-
> > invokeAction(Object(CakeRequest))
> #5 C:\xampp\cake-2.0\lib\Cake\Routing\Dispatcher.php(89): Dispatcher-
> > _invoke(Object(UsersController), Object(CakeRequest),
> Object(CakeResponse))
> #6 C:\xampp\htdocs\index.php(99): Dispatcher-
> > dispatch(Object(CakeRequest), Object(CakeResponse))
> #7 {main}
> 
> What am I doing wrong?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to