Live Chat

We'll need to share your messages (and your email address if you're logged in) with our live chat provider, Drift. Here's their privacy policy.

If you don't want to do this, you can email us instead at Module

The module contains functions for sending and receiving email in your Anvil app.



Create a new ‘Address’ object

Address Attributes

address - string

The email address this object represents.

name - string

The name associated with the address this object represents.

raw_value - string

The full string value of this address.


Create a new ‘DeliveryFailure’ object




Create a new ‘Message’ object

Instance Methods

get_header(header_name, [default=None])

Return the value of the specified header, or default value if it is not present.

Case-insensitive. If the header is specified multiple times, returns the first value.


Return a list containing every value of the specified header. Case-insensitive.

reply([cc=], [bcc=], [from_address=], [from_name=], [text=], [html=], [attachments=])

Reply to this email.

Message Attributes

addressees - instance

The addresses this email was sent from and to, according to the headers.

attachments - list(anvil.Media instance)

A list of this email’s attachments.

dkim - instance

Object describing whether this message was signed by the sending domain

envelope - instance

The sender and receipient of this email, according to the SMTP envelope.

headers - list

All the headers in this email, as a list of (name,value) pairs.

html - string

The HTML content of this email, or None if there is no HTML part.

inline_attachments - dict(string,anvil.Media instance)

A dictionary of this email’s inline attachments. Keys are ContentID headers, values are the attachments as Media Objects.

subject - string

The subject of this email, or None if there is no subject.

text - string

The plain-text content of this email, or None if there is no plain-text part.


Create a new ‘SendFailure’ object




Create a new ‘SendReport’ object

SendReport Attributes

message_id - string

The Message-ID header given to this outgoing message.


send([to=], [cc=], [bcc=], [from_address="no-reply"], [from_name=], [subject=], [text=], [html=], [attachments=], [inline_attachments=]) → instance

Send an email