Camel.MimeMessage¶
- Subclasses:
None
Methods¶
- Inherited:
Camel.MimePart (26), Camel.Medium (8), Camel.DataWrapper (32), GObject.Object (37)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Camel.MimeMessage(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Camel.MimeMessage
object- Return type:
Create a new
Camel.MimeMessage
object.
- build_mbox_from()¶
- Returns:
an MBox from-line suitable for use in an mbox file
- Return type:
Build an MBox from-line from self.
- dump(body)¶
- Parameters:
body (
int
) – whether to dump also message body
Dump information about the mime message to stdout.
If body is
True
, then dump body content of the message as well.
- encode_8bit_parts()¶
Encode all message parts to a suitable transfer encoding for transport (7bit clean).
- foreach_part(callback, *user_data)¶
- Parameters:
callback (
Camel.ForeachPartFunc
orNone
) – aCamel.ForeachPartFunc
callback to call for eachCamel.part
user_data (
object
orNone
) – user data passed to the callback
Calls callback for each
Camel.part
of the self, including the message itself. The traverse of the self parts can be stopped when the callback returnsFalse
.New in version 3.34.
- get_date()¶
-
Get the date and UTC offset of a message. See
Camel.MimeMessage.set_date
() for information about the offset format.
- get_date_received()¶
- Returns:
the received date of the message
- offset:
output for the UTC offset
- Return type:
Get the received date and UTC offset of a message. See
Camel.MimeMessage.set_date
() for information about the offset format.
- get_from()¶
- Returns:
the from address of the message
- Return type:
Get the from address of a message.
- get_message_id()¶
-
Get the message-id of a message.
- get_part_by_content_id(content_id)¶
- Parameters:
content_id (
str
) – content-id to search for- Returns:
the MIME
Camel.part
with the requested id, orNone
if not found- Return type:
Get a MIME
Camel.part
by id from a message.
- get_recipients(type)¶
- Parameters:
type (
str
) – recipient type- Returns:
the requested recipients
- Return type:
Get the message recipients of a specified type.
- get_reply_to()¶
- Returns:
the Reply-To address of the message
- Return type:
Get the Reply-To of a message.
- get_source()¶
-
Get the UID of the source account of the message.
- get_subject()¶
-
Get the UTF-8 subject text of a message.
- has_8bit_parts()¶
-
Find out if a message contains 8bit or binary encoded parts.
- has_attachment()¶
- Return type:
Returns whether message contains at least one attachment
Camel.part
.New in version 2.28.
- set_best_encoding(required, enctype)¶
- Parameters:
required (
Camel.BestencRequired
) – a bitwise ORing ofCamel.BestencRequired.GET_ENCODING
andCamel.BestencRequired.GET_CHARSET
enctype (
Camel.BestencEncoding
) – an encoding to enforce
Re-encode all message parts to conform with the required encoding rules.
If enctype is
Camel.BestencEncoding._7BIT
, then all parts will be re-encoded into one of the 7bit transfer encodings. If enctype isCamel.BestencEncoding._8BIT
, all parts will be re-encoded to either a 7bit encoding or, if theCamel.part
is 8bit text, allowed to stay 8bit. If enctype isCamel.BestencEncoding.BINARY
, then binary parts will be encoded as binary and 8bit textual parts will be encoded as 8bit.
- set_date(date, offset)¶
- Parameters:
date (
int
) – a time_t date orCamel.MESSAGE_DATE_CURRENT
to use the current local date and timeoffset (
int
) – an offset from UTC in decimal number using the +HHMM format (for instance an offset of -10:45 is -1045). If date set toCamel.MESSAGE_DATE_CURRENT
, this parameter is ignored
Set the date on a message.
In most cases, this is used to set the current date:
camel_mime_message_set_date (message, CAMEL_MESSAGE_DATE_CURRENT, 0);
- set_from(from_)¶
- Parameters:
from (
Camel.InternetAddress
orNone
) – aCamel.InternetAddress
object
Set the from address of a message.
- set_message_id(message_id)¶
- Parameters:
message_id (
str
orNone
) – id of the message, orNone
to generate a new one using the from address
Set the message-id on a message.
- set_recipients(type, recipients)¶
- Parameters:
type (
str
) – recipient type (one ofCamel.RECIPIENT_TYPE_TO
,Camel.RECIPIENT_TYPE_CC
, orCamel.RECIPIENT_TYPE_BCC
)recipients (
Camel.InternetAddress
orNone
) – aCamel.InternetAddress
with the recipient addresses set orNone
to remove the already defined one
Set the recipients of a message.
- set_reply_to(reply_to)¶
- Parameters:
reply_to (
Camel.InternetAddress
orNone
) – aCamel.InternetAddress
object
Set the Reply-To of a message.
- set_source(source_uid)¶
-
Set the UID of the source account of the message.