#[non_exhaustive]pub struct OutgoingEmail {Show 14 fields
pub from: Vec<Address>,
pub sender: Option<Address>,
pub to: Vec<Address>,
pub cc: Vec<Address>,
pub bcc: Vec<Address>,
pub reply_to: Vec<Address>,
pub date: Option<DateTime>,
pub subject: String,
pub body_text: Option<String>,
pub body_html: Option<String>,
pub in_reply_to: Vec<String>,
pub references: Vec<String>,
pub attachments: Vec<OutgoingAttachment>,
pub extra_headers: Vec<(HeaderName, String)>,
}Expand description
An outgoing email to be built into raw RFC 5322 bytes.
Used as input to crate::build_message.
§References
- RFC 5322 (message format)
- RFC 2046 (MIME multipart)
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.from: Vec<Address>Originator mailboxes (RFC 5322 Section 3.6.2: from = "From:" mailbox-list).
Must contain at least one address. When multiple addresses are present,
sender must be set per RFC 5322 Section 3.6.2:
“If the from field contains more than one mailbox specification in the
mailbox-list, then the sender field, containing the field value
corresponding to the responsible agent, MUST appear in the message.”
sender: Option<Address>The agent responsible for actual transmission of the message
(RFC 5322 Section 3.6.2: sender = "Sender:" mailbox).
Required when from contains more than one address. Optional when
from contains exactly one address.
to: Vec<Address>To recipients (RFC 5322 Section 3.6.3).
cc: Vec<Address>Cc recipients (RFC 5322 Section 3.6.3).
bcc: Vec<Address>Bcc recipients — included in SMTP envelope (RCPT TO) but must not
appear in message headers (RFC 5322 Section 3.6.3).
reply_to: Vec<Address>Reply-To addresses (RFC 5322 Section 3.6.2: address-list).
date: Option<DateTime>Explicit origination date (RFC 5322 Section 3.6.1).
When None, crate::build_message uses the current UTC time.
Set this when building drafts, re-sending, or importing messages
that require a specific date.
subject: StringSubject line (RFC 5322 Section 3.6.5).
body_text: Option<String>Plain text body.
body_html: Option<String>HTML body.
in_reply_to: Vec<String>In-Reply-To message-IDs — bare addr-spec values (no angle brackets),
builder wraps each in angle brackets for the wire format and silently
drops malformed IDs (RFC 5322 Section 3.6.4: in-reply-to = 1*msg-id).
Accepts plain strings so that parsed message-IDs (which may be
non-conformant) can flow directly from ParsedEmail into a reply
without fallible conversion.
references: Vec<String>References message-IDs — bare addr-spec values (no angle brackets),
builder wraps each in angle brackets for the wire format and silently
drops malformed IDs (RFC 5322 Section 3.6.4: references = 1*msg-id).
Accepts plain strings for the same reason as in_reply_to.
attachments: Vec<OutgoingAttachment>File attachments.
extra_headers: Vec<(HeaderName, String)>Additional headers to include verbatim (RFC 5322 Section 3.6.8).
Each entry is a (field-name, unstructured-value) pair. The
HeaderName newtype enforces RFC 5322 Section 2.2 ftext syntax at
construction time. Values are sanitized (CR/LF stripped) and long
lines are folded per RFC 5322 Section 2.2.3. Headers are emitted
after the standard headers (From, To, Subject, etc.) in the order
they appear here.
Trait Implementations§
Source§impl Clone for OutgoingEmail
impl Clone for OutgoingEmail
Source§fn clone(&self) -> OutgoingEmail
fn clone(&self) -> OutgoingEmail
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more