Skip to main content
.. contents::

PSERVER.MAILER
==============


Configuration
-------------

config.json can include mailer section::

"applications": ["pserver.mailer"],
"mailer": {
"default_sender": "foo@bar.com",
"endpoints": {
"default": {
"type": "smtp",
"host": "localhost",
"port": 25
}
}
}


Printing mailer
---------------

For development/debugging, you can use a console print mailer::

"applications": ["pserver.mailer"],
"mailer": {
"default_sender": "foo@bar.com",
"endpoints": {
"default": {
"type": "smtp",
"host": "localhost",
"port": 25
}
},
"utility": "pserver.mailer.utility.PrintingMailerUtility"
}


Sending mail
------------

POST http://localhost:8080/zodb/plone/@mailer

{
"sender": "foo@bar.com",
"recipient": "john@doe.com",
"subject": "Some subject",
"text": "Hello"
}


Permissions
-----------

`pserver.mailer` defines a permission `mailer.SendMail` which, by default,
only the `plone.SiteAdmin` role is assigned.


Using the mailer in code
------------------------

You can also directly use the mailer in your code::

from zope.component import queryUtility
from pserver.mailer.interfaces import IMailer
mailer = queryUtility(IMailer)
await mailer.send(recipient='john@doe.com', subject='This is my subject', text='Body of email')

1.0.0 (2017-02-01)
------------------

- Initial release

Release files for pserver.mailer 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pserver.mailer 1.0.0
File Size Uploaded
pserver.mailer-1.0.0.tar.gz 5.2 kB Details

Release files / pserver.mailer-1.0.0.tar.gz

Download URL pserver.mailer-1.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
07a143d793c6b87c6fc7ee30d9908154d20f330c84bae1eb1f9e130f77d74b84
BLAKE2b-256 checksum
How to use checksums
17b7bbbad0f1353a7f5e9cef0b2d074c034974415cadee93fff76ca8eddf5017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page