Re: Send Email using Shell in CakePHP
Does it work if you send the email from a controller? Does it work if
you send the email from a normal PHP script?
On Tue, Aug 7, 2012 at 6:09 AM, NewBie <tuanlt47@gmail.com> wrote:
> I write a Shell for sending email like this :
>
> <?php
> class SendMailShell extends Shell {
> function main() {
> App::import('Core', array('Controller'));
> App::import('Component', array('Email'));
> $this->Controller =& new Controller();
> $this->Email =& new EmailComponent();
> $this->Email->startup($this->Controller);
> $this->Email->reset();
> $this->Email->to = 'Jonny <Jonny@unita.net>';
> $this->Email->subject = "Subject";
> $this->Email->from = "Jonny@unita.net";
> $this->Email->template = 'default';
> $this->Email->sendAs = "html";
> $this->Email->send();
> }
> }
> ?>
>
> ---- Program execute successfully, but Email do not send to Jonny@unita.net.
> I research and do like some guild line in internet but not done.
> Please help me!
>
> --
> 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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home