marrow/marrow.mailer — Issue #36: Incorrect example in README
Author: utkarsh2012
Created: 2011-12-24 06:16:54+00:00
State: open

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
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.