try this in your config/environment.py's at the END of
load_environment function

    pylons.config.update(config)
    tm_pylons.start_extension()

without update, the recent pylons doens't work for me, too.

I copied my settings

[DEFAULT]
...
...
mail.on = true
mail.manager = immediate
mail.transport = smtp
mail.provider = smtp

mail.smtp.server = smtp_host:someport
mail.smtp.username = some...@example.com
mail.smtp.password = secket
mail.smtp.tls= true
mail.smtp.debug=true

[app:main]
...
mail.on = true


This should work for pylons >= 1.0

--
krish
http://www.stacked.in

On Aug 19, 3:09 am, Mariano Mara <mariano.m...@gmail.com> wrote:
> Excerpts from Bzouchir's message of Wed Aug 11 10:16:21 -0300 2010:
>
>
>
> > hi guys,
> > I am trying to setup TurboMail 3 with Pylons 1.0
>
> > Followed the docs
> >http://packages.python.org/TurboMail/chapters/detailed.html#pylons
>
> > I have added this to the development.ini
>
> > ******************
> > [DEFAULT]
> > ...
> > mail.on = true
> > mail.manager = immediate
> > mail.transport = smtp
> > mail.smtp.server = localhost
>
> > ******************
>
> > and my app_globals.py looks like:
>
> > ******************
> > """The application's Globals object"""
>
> > from beaker.cache import CacheManager
> > from beaker.util import parse_cache_config_options
>
> > class Globals(object):
>
> >     def __init__(self, config):
> >         self.cache =
> > CacheManager(**parse_cache_config_options(config))
>
> >      from turbomail.adapters import tm_pylons
> >      tm_pylons.start_extension()
> > ******************
>
> > My controller has this method:
>
> > ******************
> > def submit(self):
> >     message = Message("f...@example.com", "t...@example.com", "Hello
> > World")
> >     message.plain = "TurboMail is really easy to use."
> >     message.send()
> > ******************
>
> > The problem is that I am getting this error when message.send() is
> > been called:
>
> > MailNotEnabledException: An attempt was made to use a facility of the
> > TurboMail framework but outbound mail hasn't been enabled in the
> > config file [via mail.on]
>
> > I don't know what am I missing here? It all seems right according to
> > the docs!
>
> > Thanks
>
> I have it working (TurboMail 3.0.3)
> This is my app_globals:
>
> ******************
> """The application's Globals object"""
>
> from beaker.cache import CacheManager
> from beaker.util import parse_cache_config_options
>
> class Globals(object):
>     """Globals acts as a container for objects available throughout the
>     life of the application
>
>     """
>
>     def __init__(self, config):
>         """One instance of Globals is created during application
>         initialization and is available during requests via the
>         'app_globals' variable
>
>         """
>         self.cache = CacheManager(**parse_cache_config_options(config))
>         from turbomail.adapters import tm_pylons
>         tm_pylons.start_extension(config)
>
> ******************
>
> I also recall (or at least I think I remember doing it) modifying the adapter 
> source code and adding the "config" option:
>
> ******************
> /TurboMail-3.0.3-py2.6/turbomail/adapters/tm_pylons.py
>
> def start_extension(config):
>     # There is no guarantee that atexit calls shutdown but Pylons does not
>     # provide other mechanisms!
>     atexit.register(shutdown_extension)
>
>     # interface.start will exit immediately if TurboMail is not enabled.
>     interface.start(FakeConfigObj(config))
>
> ******************
>
> I think that's all I did.
>
> Mariano

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-disc...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to