It looks like I have the same setup as you have, an email in a
variable and a default email as a constant.
My code is like this:
[code]
define('DEFAULT_TO_ADDRESS','<ad...@somewhere.eu>');
...
$this->Email->to = (APPLICATION_STATE == APPLICATION_STATE_PROD) ? '<'.
$emailAddress.'>' : DEFAULT_TO_ADDRESS;
[/code]

What happens in my code is that I check for whether or not I am in a
production environment. If I am, then I use the email in the variable,
else the email in the constant.

This works for me, so take a look at your code, make whatever changes
are necessary and try again. Observe that I encloses my email
addresses in "<" and ">".
Then tell us about it! :)
Enjoy,
   John


On Jun 16, 8:19 pm, Daniel <daniel.g...@gmail.com> wrote:
> my bad, that's working:
> $to =  'exampleem...@domain.com';
> $this->Email->to = $to;
>
> ..typo mistake.
>
> but when i include in my controller a config.php file:
> <?php
> define('EMAIL', 'exam...@domain.com');
> ?>
>
> and try to use EMAIL to set the destination, it doesn't work :-(.
> i have tried to set a $email variable with EMAIL and print it out in
> view,
> it shows the correct adddress, but when i use the EMAIL to set the
> destination address for Email componnent it doesn't work.
>
[snip]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to