Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect example in README #36

Closed
utsengar opened this issue Dec 24, 2011 · 1 comment
Closed

Incorrect example in README #36

utsengar opened this issue Dec 24, 2011 · 1 comment
Labels
1.bug An error has been encountered that is preventing utilization. need:documentation Improvements or additions to documentation are required. need:example A minimal, or even better, concrete example needs to be provided.

Comments

@utsengar
Copy link

I tried to use the example given in the read me:

mailer = Mailer(dict(
        transport = dict(
                use = 'smtp',
                host = 'smtp.gmail.com',
                port = '587',
                username = username,
                password = password,
                tls = 'required',
                debug = True)))
mailer.start()

message = Message(author="f@e.com", to="t@e.com")
message.subject = "Testing Marrow Mailer"
message.plain = "This is a test."
mailer.send(message)
mailer.stop()

But i gives an exception:

Traceback (most recent call last):
  File "send_email.py", line 14, in <module>
    debug = True)))
  File "/Users/user/.virtualenvs/w1/lib/python2.7/site-packages/marrow/mailer/__init__.py", line 55, in __init__
    if isinstance(config.manager, basestring):
  File "/Users/user/.virtualenvs/w1/lib/python2.7/site-packages/marrow/util/bunch.py", line 29, in __getattr__
    raise AttributeError(name)
AttributeError: manager

So, I added manager:

mailer = Mailer(dict(
        transport = dict(
                use = 'smtp',
                host = 'smtp.gmail.com',
                port = '587',
                username = username,
                password = password,
                tls = 'required',
                debug = True),
        manager = dict()))
mailer.start()

message = Message(author="f@e.com", to="t@e.com")
message.subject = "Testing Marrow Mailer"
message.plain = "This is a test."
mailer.send(message)
mailer.stop()

And it worked.

@amcgregor
Copy link
Member

This is a bug in the configuration parser, not in the included README. Manager should successfully default to immediate without needing a configuration defined.

@amcgregor amcgregor added 1.bug An error has been encountered that is preventing utilization. need:documentation Improvements or additions to documentation are required. need:example A minimal, or even better, concrete example needs to be provided. and removed area:core Relating to a core aspect of the library such as configuration and initialization. labels Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.bug An error has been encountered that is preventing utilization. need:documentation Improvements or additions to documentation are required. need:example A minimal, or even better, concrete example needs to be provided.
Projects
None yet
Development

No branches or pull requests

2 participants