Package turbomail :: Module message :: Class Message
[hide private]
[frames] | no frames]

Class Message

source code

 object --+    
          |    
BaseMessage --+
              |
             Message

Simple e-mail message class.

Instance Methods [hide private]
 
__init__(self, author=None, to=None, subject=None, **kw)
Instantiate a new Message object.
source code
 
__setattr__(self, name, value)
Set the dirty flag as properties are updated.
source code
 
__str__(self)
str(x)
source code
 
_get_authors(self) source code
 
_set_authors(self, value) source code
 
mime_document(self, plain, rich=None) source code
 
_build_date_header_string(self, date_value)
Gets the date_value (may be None, basestring, float or datetime.datetime instance) and returns a valid date string as per RFC 2822.
source code
 
_build_header_list(self, author, sender) source code
 
_add_headers_to_message(self, message, headers) source code
 
attach(self, file, name=None)
Attach an on-disk file to this message.
source code
 
embed(self, file, name=None)
Attach an on-disk image file and prepare for HTML embedding.
source code
 
_callable(self, var) source code
 
get_replyto(self) source code
 
set_replyto(self, replyto) source code

Inherited from BaseMessage: get_recipient, get_smtpfrom, kwpop, merge_if_set, pop_deprecated, send, set_recipient, set_smtpfrom

Inherited from BaseMessage (private): _warn_about_deprecated_property

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __subclasshook__

Properties [hide private]
  author
  bcc
  cc
  disposition
  reply_to
  sender
  authors
  id
  envelope_sender
Returns the address of the envelope sender address (SMTP from, if not set the sender, if this one isn't set too, the author).
  recipients
  mime
Produce the final MIME message.
  replyto

Inherited from BaseMessage: recipient, smtp_from, smtpfrom, to

Inherited from object: __class__

Method Details [hide private]

__init__(self, author=None, to=None, subject=None, **kw)
(Constructor)

source code 

Instantiate a new Message object.

No arguments are required, as everything can be set using class properties. Alternatively, everything can be set using the constructor, using named arguments. The first three positional arguments can be used to quickly prepare a simple message.

Overrides: object.__init__

__setattr__(self, name, value)

source code 

Set the dirty flag as properties are updated.

Overrides: object.__setattr__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

embed(self, file, name=None)

source code 

Attach an on-disk image file and prepare for HTML embedding.

This method should only be used to embed images.

Parameters:
  • file - The path to the file you wish to attach, or an instance of a file-like object.
  • name (string) - You can optionally override the filename of the attached file. This name will appear in the recipient's mail viewer. Optional if passing an on-disk path. Required if passing a file-like object.

Property Details [hide private]

author

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)
Delete Method:
unreachable.fdel(self)

bcc

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)
Delete Method:
unreachable.fdel(self)

cc

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)
Delete Method:
unreachable.fdel(self)

disposition

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)
Delete Method:
unreachable.fdel(self)

reply_to

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)
Delete Method:
unreachable.fdel(self)

sender

Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, value)
Delete Method:
unreachable.fdel(self)

authors

Get Method:
_get_authors(self)
Set Method:
_set_authors(self, value)

id

Get Method:
unreachable.id(self)

envelope_sender

Returns the address of the envelope sender address (SMTP from, if not set the sender, if this one isn't set too, the author).

Get Method:
unreachable.envelope_sender(self) - Returns the address of the envelope sender address (SMTP from, if not set the sender, if this one isn't set too, the author).

recipients

Get Method:
unreachable.recipients(self)

mime

Produce the final MIME message.

Get Method:
unreachable.mime(self) - Produce the final MIME message.

replyto

Get Method:
get_replyto(self)
Set Method:
set_replyto(self, replyto)