Part of twisted.mail View Source
Interface | IMessageDelivery | No interface docstring; 3/3 methods documented |
Interface | IMessageDeliveryFactory | An alternate interface to implement for handling message delivery. |
Class | SMTPError | Undocumented |
Class | SMTPClientError | Base class for SMTP client errors. |
Class | ESMTPClientError | Base class for ESMTP client errors. |
Class | EHLORequiredError | The server does not support EHLO. |
Class | AUTHRequiredError | Authentication was required but the server does not support it. |
Class | TLSRequiredError | Transport security was required but the server does not support it. |
Class | AUTHDeclinedError | The server rejected our credentials. |
Class | AuthenticationError | An error ocurred while authenticating. |
Class | TLSError | An error occurred while negiotiating for transport security. |
Class | SMTPConnectError | Failed to connect to the mail exchange host. |
Class | SMTPTimeoutError | Failed to receive a response from the server in the expected time period. |
Class | SMTPProtocolError | The server sent a mangled response. |
Class | SMTPDeliveryError | Indicates that a delivery attempt has had an error. |
Class | SMTPServerError | Undocumented |
Class | SMTPAddressError | Undocumented |
Class | SMTPBadRcpt | Undocumented |
Class | SMTPBadSender | Undocumented |
Function | rfc822date | Format an RFC-2822 compliant date string. |
Function | idGenerator | Undocumented |
Function | messageid | Return a globally unique random string in RFC 2822 Message-ID format |
Function | quoteaddr | Turn an email address, possibly with realname part etc, into a form suitable for and SMTP envelope. |
Class | AddressError | Parse error in address |
Class | Address | Parse and hold an RFC 2821 address. |
Class | User | Hold information about and SMTP message recipient, including information on where the message came from |
Interface | IMessage | Interface definition for messages that can be sent via SMTP. |
Class | SMTP | SMTP server-side protocol. |
Class | SMTPFactory | Factory for SMTP. |
Class | SMTPClient | SMTP client for sending emails. |
Class | ESMTPClient | No class docstring; 2/19 methods documented |
Class | ESMTP | No class docstring; 3/12 methods documented |
Class | SenderMixin | Utility class for sending emails easily. |
Class | SMTPSender | SMTP protocol that sends a single email based on information it gets
from its factory, a SMTPSenderFactory .
|
Class | SMTPSenderFactory | Utility factory for sending emails easily. |
Class | PLAINAuthenticator | Undocumented |
Class | ESMTPSender | Undocumented |
Class | ESMTPSenderFactory | Utility factory for sending emails easily. |
Function | sendmail | Send an email |
Function | sendEmail | Send an email, optionally with attachments. |
Function | xtext_encode | Undocumented |
Function | xtext_decode | Decode the xtext-encoded string s using a fast extension
function.
|
Class | xtextStreamReader | Undocumented |
Class | xtextStreamWriter | Undocumented |
Function | xtext_codec | Undocumented |
Function | _slowXTextDecode | Decode the xtext-encoded string s .
|
Parameters | timeinfo | (optional) A sequence as returned by time.localtime() or
time.gmtime() . Default is now.
|
local | (optional) Indicates if the supplied time is local or universal time, or if no time is given, whether now should be local or universal time. Default is local, as suggested (SHOULD) by rfc-2822. | |
Returns | A string representing the time and date in RFC-2822 format. |
Return a globally unique random string in RFC 2822 Message-ID format
<datetime.pid.random@host.dom.ain>
Optional uniq string will be added to strenghten uniqueness if given.Send an email
This interface is intended to be a direct replacement for smtplib.SMTP.sendmail() (with the obvious change that you specify the smtphost as well). Also, ESMTP options are not accepted, as we don't do ESMTP yet. I reserve the right to implement the ESMTP options differently.Parameters | smtphost | The host the message should be sent to |
from_addr | The (envelope) address sending this mail. | |
to_addrs | A list of addresses to send this mail to. A string will be treated as a list of one address | |
msg | The message, including headers, either as a file or a string. File-like objects need to support read() and close(). Lines must be delimited by '\n'. If you pass something that doesn't look like a file, we try to convert it to a string (so you should be able to pass an email.Message directly, but doing the conversion with email.Generator manually will give you more control over the process). | |
senderDomainName | Name by which to identify. If None, try to pick something sane (but this depends on external configuration and may not succeed). | |
port | Remote port to which to connect. | |
Returns | A Deferred
) |
Parameters | smtphost | hostname of SMTP server to which to connect (type: str ) |
fromEmail | email address to indicate this email is from (type: str ) | |
toEmail | email address to which to send this email (type: str ) | |
content | The body if this email. (type: str ) | |
headers | Dictionary of headers to include in the email (type: dict ) | |
attachments | Each 3-tuple should consist of the name of the attachment, the mime-type of the attachment, and a string that is the attachment itself. (type: list of 3-tuples ) | |
multipartbody | The type of MIME multi-part body. Generally either "mixed" (as in text and images) or "alternative" (html email with a fallback to text/plain). (type: str ) | |
Returns | The returned Deferred has its callback or errback invoked when the mail is successfully sent or when an error occurs, respectively. (type: Deferred ) |
s
using a fast extension
function.