The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From: WhyNotSmile <sharongilmor...@gmail.com>
Date: Fri, 18 May 2012 04:08:51 -0700 (PDT)
Local: Fri, May 18 2012 7:08 am
Subject: How do I send emails from AppController? (CakePHP 2.0)
I've been sending emails from my PagesController, and that has been working I wondered if maybe it can't find the view file or something like that? Here is my code (in AppController): function sendSystemEmail($to = EMAIL_CONTACT, $from = array(EMAIL_FROM > => SITE_NAME), $subject = null, $body = null, $view = null, $vars = null) { Thanks for any help you can give! > App::uses('CakeEmail', 'Network/Email'); > $email = new CakeEmail(); > $email->viewVars(array( > 'body' => $body, > 'vars' => $vars > )); > $email->template($view) > ->emailFormat('html') > ->from(EMAIL_FROM) > ->to($to) > ->subject($subject) > ->send(); > return; > } You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||