Class Message
source code
Represents an email message.
Set the To, From, Subject, and Body attributes as plain-text strings.
Optionally, set the Html attribute to send an HTML email, or use the
attach() method to attach files.
Use the charset property to send messages using other than
us-ascii
If you specify an attachments argument, it should be a list of
attachment filenames: ["file1.txt", "file2.txt"]
`To` should be a string for a single address, and a sequence of
strings for multiple recipients (castable to list)
Send using the Mailer class.
|
|
__init__(self,
To=None,
From=None,
Subject=None,
Body=None,
Html=None,
attachments=None,
charset=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature |
source code
|
|
|
|
as_string(self)
Get the email as a string to send in the mailer |
source code
|
|
|
|
_plaintext(self)
Plain text email with no attachments |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
| _add_attachment(self,
outer,
filename,
cid) |
source code
|
|
|
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
|
To
string or iterable
|
|
|
From
string
|
|
Inherited from object:
__class__
|
__init__(self,
To=None,
From=None,
Subject=None,
Body=None,
Html=None,
attachments=None,
charset=None)
(Constructor)
| source code
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Overrides:
object.__init__
- (inherited documentation)
|
Attach a file to the email. Specify the name of the file; Message will
figure out the MIME type and load the file.
|