Re: Can't email using the Email Component
I use Eclipse PDT combined with XDebug to step through the code that's being executed to detect where the mail sending fails. In this case I would suggest to simple remove the @ in the __mail() function from the Email Component (/cake/libs/controllers/components/email.php) : function __mail() { $header = implode("\n", $this->__header); $message = implode("\n", $this->__message); if (ini_get('safe_mode')) { return mail($this->to, $this->__encode($this->subject), $message, $header); } return mail($this->to, $this->__encode($this->subject), $message, $header, $this->additionalParams); } This will hopefully show a warning or error from the mail function telling you why the mail isn't being sent out ... Hope this helps. On Fri, Sep 18, 2009 at 7:27 PM, lovettcreati...@gmail.com < ed...@lovettcreations.org> wrote: > What do you emain you usually debug into the Email Components? > > On Sep 18, 1:48 am, Bert Van den Brande wrote: > > Have you tested the PHP mail() function directly ? > > > > The problem with the EmailComponent is that it hides any indicative mail > > errors that would help you find the cause for the problem ... > > > > I usually debug into the EmailComponents send code ... > > > > On Fri, Sep 18, 2009 at 7:00 AM, damanlovett >wrote: > > > > > > > > > I have read every tutorial and discussion but I can't get the email to > > > send out. Below is an excerpt from my controller. It redirects fine, > > > but I still get "Simple email not sent". Is there some setting in the > > > core or somewhere else that I'm missing? > > > > > var $components = array('Email'); > > > > >function sendemail(){ > > > > >$this->Email->to = 'ed...@myemail.com'; > > >$this->Email->subject = 'Cake test simple email'; > > >$this->Email->replyTo = 'nore...@localhost'; > > >$this->Email->from = 'Cake Test Account '; > > >$this->Email->delivery = 'mail'; > > > > >if ( $this->Email->send('Here is the body of the email') ) { > > >$this->Session->setFlash('Simple email sent'); > > >} else { > > >$this->Session->setFlash('Simple email not sent'); > > >} > > >$this->redirect('/offices'); > > >} > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en -~--~~~~--~~--~--~---
Re: Can't email using the Email Component
What I mean is that the EmailComponent uses @mail() , this suppresses the warnings/errors resulting from that function call. Btw the mail() function only returns a boolean , not a message of any kind. On Fri, Sep 18, 2009 at 11:01 AM, Walther wrote: > > If you look at the code, you'll notice that it returns exactly the > same thing as php mail() will return. > > On Sep 18, 7:48 am, Bert Van den Brande wrote: > > Have you tested the PHP mail() function directly ? > > > > The problem with the EmailComponent is that it hides any indicative mail > > errors that would help you find the cause for the problem ... > > > > I usually debug into the EmailComponents send code ... > > > > On Fri, Sep 18, 2009 at 7:00 AM, damanlovett >wrote: > > > > > > > > > I have read every tutorial and discussion but I can't get the email to > > > send out. Below is an excerpt from my controller. It redirects fine, > > > but I still get "Simple email not sent". Is there some setting in the > > > core or somewhere else that I'm missing? > > > > > var $components = array('Email'); > > > > >function sendemail(){ > > > > >$this->Email->to = 'ed...@myemail.com'; > > >$this->Email->subject = 'Cake test simple email'; > > >$this->Email->replyTo = 'nore...@localhost'; > > >$this->Email->from = 'Cake Test Account '; > > >$this->Email->delivery = 'mail'; > > > > >if ( $this->Email->send('Here is the body of the email') ) { > > >$this->Session->setFlash('Simple email sent'); > > >} else { > > >$this->Session->setFlash('Simple email not sent'); > > >} > > >$this->redirect('/offices'); > > >} > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en -~--~~~~--~~--~--~---
Re: Can't email using the Email Component
If you look at the code, you'll notice that it returns exactly the same thing as php mail() will return. On Sep 18, 7:48 am, Bert Van den Brande wrote: > Have you tested the PHP mail() function directly ? > > The problem with the EmailComponent is that it hides any indicative mail > errors that would help you find the cause for the problem ... > > I usually debug into the EmailComponents send code ... > > On Fri, Sep 18, 2009 at 7:00 AM, damanlovett wrote: > > > > > I have read every tutorial and discussion but I can't get the email to > > send out. Below is an excerpt from my controller. It redirects fine, > > but I still get "Simple email not sent". Is there some setting in the > > core or somewhere else that I'm missing? > > > var $components = array('Email'); > > > function sendemail(){ > > > $this->Email->to = 'ed...@myemail.com'; > > $this->Email->subject = 'Cake test simple email'; > > $this->Email->replyTo = 'nore...@localhost'; > > $this->Email->from = 'Cake Test Account '; > > $this->Email->delivery = 'mail'; > > > if ( $this->Email->send('Here is the body of the email') ) { > > $this->Session->setFlash('Simple email sent'); > > } else { > > $this->Session->setFlash('Simple email not sent'); > > } > > $this->redirect('/offices'); > > } > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en -~--~~~~--~~--~--~---
Re: Can't email using the Email Component
Have you tested the PHP mail() function directly ? The problem with the EmailComponent is that it hides any indicative mail errors that would help you find the cause for the problem ... I usually debug into the EmailComponents send code ... On Fri, Sep 18, 2009 at 7:00 AM, damanlovett wrote: > > I have read every tutorial and discussion but I can't get the email to > send out. Below is an excerpt from my controller. It redirects fine, > but I still get "Simple email not sent". Is there some setting in the > core or somewhere else that I'm missing? > > var $components = array('Email'); > >function sendemail(){ > >$this->Email->to = 'ed...@myemail.com'; >$this->Email->subject = 'Cake test simple email'; >$this->Email->replyTo = 'nore...@localhost'; >$this->Email->from = 'Cake Test Account '; >$this->Email->delivery = 'mail'; > >if ( $this->Email->send('Here is the body of the email') ) { >$this->Session->setFlash('Simple email sent'); >} else { >$this->Session->setFlash('Simple email not sent'); >} >$this->redirect('/offices'); >} > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com 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?hl=en -~--~~~~--~~--~--~---