[Grok-dev] send mail queryUtility ComponentLookupError todoplus
Maurits van Rees
m.van.rees at zestsoftware.nl
Mon Aug 23 03:30:02 EDT 2010
Op 23-08-10 09:02, DIVINE, PAUL (PAUL) schreef:
> Hi Maurits van Rees,
> Thanks for your help.
> I have modified the configure.zcml two lines
> name="todoplus"
> mailer="todoplus"
> And I restarted the server.
> Then the same error is displayed.
>
> Paul Diviné
> The details are given in the following lines.
>
> << msg["To"] = ','.join(recipient)
> msg["Subject"] = email.Header.Header(subject, 'UTF-8')
> mailer = getUtility(IMailDelivery, 'todoplus')
> mailer.send(sender, recipient, msg.as_string())>> mailer = getUtility(IMailDelivery, 'todoplus')
> Module zope.component._api:171 in getUtility
> << if utility is not None:
> return utility
> raise ComponentLookupError(interface, name)
>
> def queryUtility(interface, name='', default=None, context=None):>> raise ComponentLookupError(interface, name)
> ComponentLookupError: (<InterfaceClass zope.sendmail.interfaces.IMailDelivery>, 'todoplus')
You have this in your zcml:
<mail:queuedDelivery
name="mailer"
...>
That suggests to me that you may need to write this instead:
mailer = getUtility(IMailDelivery, 'mailer')
--
Maurits van Rees
Programmer, Zest Software
More information about the Grok-dev
mailing list