This file is indexed.

/usr/share/doc/python-cement-doc/html/_sources/dev/mail.txt is in python-cement-doc 2.10.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Sending Email Messages
======================

Cement defines a mail interface called
:ref:`IMail <cement.core.mail>`, as well as the default
:ref:`DummyMailHandler <cement.ext.ext_dummy>` that implements
the interface.

Please note that there are other handlers that implement the ``IMail``
interface.  The documentation below only references usage based on the
interface and not the full capabilities of the implementation.

The following mail handlers are included and maintained with Cement:

    * :ref:`DummyMailHandler <cement.ext.ext_dummy>` (default)
    * :ref:`SMTPMailHandler <cement.ext.ext_smtp>`


Please reference the :ref:`IMail <cement.core.mail>` interface
documentation for writing your own mail handler.


Example Usage
-------------

.. code-block:: python

    from cement.core.foundation import CementApp

    class MyApp(CementApp):
        class Meta:
            label = 'myapp'

    with MyApp() as app:
        app.run()

        # send an email message
        app.mail.send('This is my message',
            subject='This is my subject',
            to=['you@example.com'],
            from_addr='me@example.com',
            cc=['him@example.com', 'her@example.com'],
            bcc=['boss@example.com']
            )


Note that the default mail handler simply prints messages to the screen, and
does not actually send anything.  You can override this pretty easily without
changing any code by using the built-in
:ref:`SMTPMailHandler <cement.ext.ext_smtp>`.  Simply modify the application
configuration to something like:

**myapp.conf**

.. code-block:: text

    [myapp]
    mail_handler = smtp

    [mail.smtp]
    ssl = 1
    tls = 1
    auth = 1
    username = john.doe
    password = oober_secure_password