pub enum EmailHeaders {
Show 102 variants
AcceptLanguage,
AlternateRecipient,
ArchivedAt,
AuthenticationResults,
AutoSubmitted,
AutoForwarded,
Autosubmitted,
Bcc,
Cc,
Comments,
ContentIdentifier,
ContentReturn,
ContentType,
ContentTransferEncoding,
Conversion,
ConversionWithLoss,
DLExpansionHistory,
Date,
DeferredDelivery,
DeliveryDate,
DiscardedX400IPMSExtensions,
DiscardedX400MTSExtensions,
DiscloseRecipients,
DispositionNotificationOptions,
DispositionNotificationTo,
DKIMSignature,
DowngradedFinalRecipient,
DowngradedInReplyTo,
DowngradedMessageId,
DowngradedOriginalRecipient,
DowngradedReferences,
Encoding,
Encrypted,
Expires,
ExpiryDate,
From,
GenerateDeliveryReport,
Importance,
InReplyTo,
IncompleteCopy,
Keywords,
Language,
LatestDeliveryTime,
ListArchive,
ListHelp,
ListId,
ListOwner,
ListPost,
ListSubscribe,
ListUnsubscribe,
ListUnsubscribePost,
MessageContext,
MessageId,
MessageType,
MIMEType,
MIMEVersion,
MTPriority,
Obsoletes,
Organization,
OriginalEncodedInformationTypes,
OriginalFrom,
OriginalMessageId,
OriginalRecipient,
OriginatorReturnAddress,
OriginalSubject,
PICSLabel,
PreventNonDeliveryReport,
Priority,
Received,
ReceivedSPF,
References,
ReplyBy,
ReplyTo,
RequireRecipientValidSince,
ResentBcc,
ResentCc,
ResentDate,
ResentFrom,
ResentMessageId,
ResentReplyTo,
ResentSender,
ResentTo,
ReturnPath,
Sender,
Sensitivity,
Solicitation,
Subject,
Supersedes,
TLSReportDomain,
TLSReportSubmitter,
TLSRequired,
To,
VBRInfo,
X400ContentIdentifier,
X400ContentReturn,
X400ContentType,
X400MTSIdentifier,
X400Originator,
X400Received,
X400Recipients,
X400Trace,
Unknown(String),
}
Expand description
§Email Headers
The headers that a email can contain. Reference: https://www.iana.org/assignments/message-headers/message-headers.xhtml
§Example
use neo_email::mail::Mail;
use neo_email::headers::EmailHeaders;
let raw_email = b"From: jean@nervio\nSubject: Hello\n\nHello, World!";
let mail = Mail::<Vec<u8>>::from_bytes(raw_email.to_vec()).unwrap();
let from = mail.headers.get(&EmailHeaders::From).unwrap();
Variants§
AcceptLanguage
§Accept-Language
The Accept-Language header field can be used by user agents to indicate the set of natural languages that are preferred in the response. Reference: https://www.iana.org/go/rfc4021
AlternateRecipient
§Alternate-Recipient
The Alternate-Recipient header field can be used to specify an alternative recipient for the message. Reference: https://www.iana.org/go/rfc4021
ArchivedAt
§Archived-At
The Archived-At header field can be used to specify the date and time at which the message was archived. Reference: https://www.iana.org/go/rfc5064
AuthenticationResults
§Authentication-Results
The Authentication-Results header field can be used to convey the results of message authentication checks. Reference: https://www.iana.org/go/rfc8601
AutoSubmitted
§Auto-Submitted
The Auto-Submitted header field can be used to indicate that the message was generated automatically. Reference: https://www.iana.org/go/rfc3834
AutoForwarded
§Autoforwarded
The Autoforwarded header field can be used to indicate that the message was automatically forwarded. Reference: https://www.iana.org/go/rfc4021
Autosubmitted
§Autosubmitted
The Autosubmitted header field can be used to indicate that the message was generated automatically. Reference: https://www.iana.org/go/rfc4021
Bcc
§Bcc
The Bcc header field can be used to specify recipients who are not to be included in the delivery of the message. Reference: https://www.iana.org/go/rfc5322
Cc
§Cc
The Cc header field can be used to specify recipients who are to receive copies of the message. Reference: https://www.iana.org/go/rfc5322
Comments
§Comments
The Comments header field can be used to provide additional information about the message. Reference: https://www.iana.org/go/rfc5322
ContentIdentifier
§Content-Identifier
The Content-Identifier header field can be used to specify a unique identifier for the message. Reference: https://www.iana.org/go/rfc4021
ContentReturn
§Content-Return
The Content-Return header field can be used to specify the return address for non-delivery reports. Reference: https://www.iana.org/go/rfc4021
ContentType
§Content-Type
The Content-Type header field can be used to specify the media type of the message content. Reference: https://www.iana.org/go/rfc4021
ContentTransferEncoding
§Content-Transfer-Encoding
The Content-Transfer-Encoding header field can be used to specify the encoding used for the message content. Reference: https://www.iana.org/go/rfc4021
Conversion
§Conversion
The Conversion header field can be used to specify the conversion information for the message. Reference: https://www.iana.org/go/rfc4021
ConversionWithLoss
§Conversion-With-Loss
The Conversion-With-Loss header field can be used to specify the conversion information for the message with loss. Reference: https://www.iana.org/go/rfc4021
DLExpansionHistory
§DL-Expansion-History
The DL-Expansion-History header field can be used to specify the expansion history of a distribution list. Reference: https://www.iana.org/go/rfc4021
Date
§Date
The Date header field can be used to specify the date and time at which the message was sent. Reference: https://www.iana.org/go/rfc5322
DeferredDelivery
§Deferred-Delivery
The Deferred-Delivery header field can be used to specify the date and time at which the message is to be delivered.
DeliveryDate
§Delivery-Date
The Delivery-Date header field can be used to specify the date and time at which the message was delivered.
DiscardedX400IPMSExtensions
§Discarded-X400-IPMS-Extensions
The Discarded-X400-IPMS-Extensions header field can be used to specify the IPMS extensions that were discarded.
DiscardedX400MTSExtensions
§Discarded-X400-MTS-Extensions
The Discarded-X400-MTS-Extensions header field can be used to specify the MTS extensions that were discarded. Reference: https://www.iana.org/go/rfc4021
DiscloseRecipients
§Disclose-Recipients
The Disclose-Recipients header field can be used to specify whether the recipients of the message are disclosed. Reference: https://www.iana.org/go/rfc4021
DispositionNotificationOptions
§Disposition-Notification-Options
The Disposition-Notification-Options header field can be used to specify the options for disposition notifications. Reference: https://www.iana.org/go/rfc4021
DispositionNotificationTo
§Disposition-Notification-To
The Disposition-Notification-To header field can be used to specify the recipient for disposition notifications. Reference: https://www.iana.org/go/rfc4021
DKIMSignature
§DKIM-Signature
The DKIM-Signature header field can be used to specify the DKIM signature for the message. Reference: https://www.iana.org/go/rfc6376
DowngradedFinalRecipient
§Downgraded-Final-Recipient
The Downgraded-Final-Recipient header field can be used to specify the final recipient of the message. Reference: https://www.iana.org/go/rfc6857
DowngradedInReplyTo
§Downgraded-In-Reply-To
The Downgraded-In-Reply-To header field can be used to specify the message that this message is a reply to. Reference: https://www.iana.org/go/rfc6857
DowngradedMessageId
§Downgraded-Message-Id
The Downgraded-Message-Id header field can be used to specify the message identifier of the message. Reference: https://www.iana.org/go/rfc6857
DowngradedOriginalRecipient
§Downgraded-Original-Recipient
The Downgraded-Original-Recipient header field can be used to specify the original recipient of the message. Reference: https://www.iana.org/go/rfc6857
DowngradedReferences
§Downgraded-References
The Downgraded-References header field can be used to specify the references for the message. Reference: https://www.iana.org/go/rfc6857
Encoding
§Encoding
The Encoding header field can be used to specify the encoding of the message. Reference: https://www.iana.org/go/rfc4021
Encrypted
§Encrypted
The Encrypted header field can be used to specify whether the message is encrypted. Reference: https://www.iana.org/go/rfc4021
Expires
§Expires
The Expires header field can be used to specify the expiration date of the message. Reference: https://www.iana.org/go/rfc4021
ExpiryDate
§Expiry-Date
The Expiry-Date header field can be used to specify the expiry date of the message. Reference: https://www.iana.org/go/rfc4021
From
§From
The From header field can be used to specify the author of the message. Reference: https://www.iana.org/go/rfc5322
GenerateDeliveryReport
§Generate-Delivery-Report
The Generate-Delivery-Report header field can be used to specify whether a delivery report should be generated. Reference: https://www.iana.org/go/rfc4021
Importance
§Importance
The Importance header field can be used to specify the importance of the message. Reference: https://www.iana.org/go/rfc4021
InReplyTo
§In-Reply-To
The In-Reply-To header field can be used to specify the message that this message is a reply to. Reference: https://www.iana.org/go/rfc5322
§Incomplete-Copy
The Incomplete-Copy header field can be used to specify that the message is an incomplete copy. Reference: https://www.iana.org/go/rfc4021
IncompleteCopy
§Keywords
The Keywords header field can be used to specify the keywords for the message. Reference: https://www.iana.org/go/rfc5322
Keywords
§Keywords
The Keywords header field can be used to specify the keywords for the message. Reference: https://www.iana.org/go/rfc5322
Language
§Language
The Language header field can be used to specify the language of the message. Reference: https://www.iana.org/go/rfc4021
LatestDeliveryTime
§Latest-Delivery-Time
The Latest-Delivery-Time header field can be used to specify the latest time at which the message should be delivered. Reference: https://www.iana.org/go/rfc4021
ListArchive
§List-Archive
The List-Archive header field can be used to specify the URI for the list archive. Reference: https://www.iana.org/go/rfc4021
ListHelp
§List-Help
The List-Help header field can be used to specify the URI for the list help. Reference: https://www.iana.org/go/rfc4021
ListId
§List-Id
The List-Id header field can be used to specify the identifier for the list. Reference: https://www.iana.org/go/rfc4021
ListOwner
§List-Owner
The List-Owner header field can be used to specify the owner of the list.
ListPost
§List-Post
The List-Post header field can be used to specify the URI for posting to the list. Reference: https://www.iana.org/go/rfc4021
ListSubscribe
§List-Subscribe
The List-Subscribe header field can be used to specify the URI for subscribing to the list. Reference: https://www.iana.org/go/rfc4021
ListUnsubscribe
§List-Unsubscribe
The List-Unsubscribe header field can be used to specify the URI for unsubscribing from the list. Reference: https://www.iana.org/go/rfc4021
ListUnsubscribePost
§List-Unsubscribe-Post
The List-Unsubscribe-Post header field can be used to specify the URI for unsubscribing from the list. Reference: https://www.iana.org/go/rfc8058
MessageContext
§Message-Context
The Message-Context header field can be used to specify the context of the message. Reference: https://www.iana.org/go/rfc4021
MessageId
§Message-Id
The Message-Id header field can be used to specify the identifier for the message. Reference: https://www.iana.org/go/rfc5322
MessageType
§Message-Type
The Message-Type header field can be used to specify the type of the message. Reference: https://www.iana.org/go/rfc4021
MIMEType
§MIME-Type
The MIME-Type header field can be used to specify the MIME type of the message. Reference: https://www.iana.org/go/rfc4021
MIMEVersion
§MIME-Version
The MIME-Version header field can be used to specify the MIME version of the message. Reference: https://www.iana.org/go/rfc4021
MTPriority
§MT-Priority
The MT-Priority header field can be used to specify the priority of the message. Reference: https://www.iana.org/go/rfc6758
Obsoletes
§Obsoletes
The Obsoletes header field can be used to specify the messages that this message obsoletes. Reference: https://www.iana.org/go/rfc4021
Organization
§Organization
The Organization header field can be used to specify the organization of the message. Reference: https://www.iana.org/go/rfc7681
OriginalEncodedInformationTypes
§Original-Encoded-Information-Types
The Original-Encoded-Information-Types header field can be used to specify the encoded information types for the message. Reference: https://www.iana.org/go/rfc4021
OriginalFrom
§Original-From
The Original-From header field can be used to specify the original author of the message. Reference: https://www.iana.org/go/rfc4021
OriginalMessageId
§Original-Message-Id
The Original-Message-Id header field can be used to specify the original message identifier of the message. Reference: https://www.iana.org/go/rfc4021
OriginalRecipient
§Original-Recipient
The Original-Recipient header field can be used to specify the original recipient of the message. Reference: https://www.iana.org/go/rfc3798
OriginatorReturnAddress
§Originator-Return-Address
The Originator-Return-Address header field can be used to specify the return address for non-delivery reports. Reference: https://www.iana.org/go/rfc4021
OriginalSubject
§Original-Subject
The Original-Subject header field can be used to specify the original subject of the message. Reference: https://www.iana.org/go/rfc4021
PICSLabel
§PICS-Label
The PICS-Label header field can be used to specify the PICS label for the message. Reference: https://www.iana.org/go/rfc4021
PreventNonDeliveryReport
§Prevent-NonDelivery-Report
The Prevent-NonDelivery-Report header field can be used to specify that non-delivery reports should not be generated. Reference: https://www.iana.org/go/rfc4021
Priority
§Priority
The Priority header field can be used to specify the priority of the message. Reference: https://www.iana.org/go/rfc4021
Received
§Received
The Received header field can be used to specify the date and time at which the message was received. Reference: https://www.iana.org/go/rfc5321
ReceivedSPF
§Received-SPF
The Received-SPF header field can be used to specify the results of the SPF check. Reference: https://www.iana.org/go/rfc7208
References
§References
The References header field can be used to specify the references for the message. Reference: https://www.iana.org/go/rfc5322
ReplyBy
§Reply-By
The Reply-By header field can be used to specify the date and time by which a reply is requested. Reference: https://www.iana.org/go/rfc4021
ReplyTo
§Reply-To
The Reply-To header field can be used to specify the address to which replies should be sent. Reference: https://www.iana.org/go/rfc5322
RequireRecipientValidSince
§Require-Recipient-Valid-Since
The Require-Recipient-Valid-Since header field can be used to specify the date and time at which the recipient was validated. Reference: https://www.iana.org/go/rfc7293
ResentBcc
§Resent-Bcc
The Resent-Bcc header field can be used to specify recipients who are not to be included in the delivery of the message. Reference: https://www.iana.org/go/rfc5322
ResentCc
§Resent-Cc
The Resent-Cc header field can be used to specify recipients who are to receive copies of the message. Reference: https://www.iana.org/go/rfc5322
ResentDate
§Resent-Date
The Resent-Date header field can be used to specify the date and time at which the message was resent. Reference: https://www.iana.org/go/rfc5322
ResentFrom
§Resent-From
The Resent-From header field can be used to specify the sender of the message. Reference: https://www.iana.org/go/rfc5322
ResentMessageId
§Resent-Message-Id
The Resent-Message-Id header field can be used to specify the message identifier of the message. Reference: https://www.iana.org/go/rfc5322
ResentReplyTo
§Resent-Reply-To
The Resent-Reply-To header field can be used to specify the reply-to address for the message. Reference: https://www.iana.org/go/rfc5322
ResentSender
§Resent-Sender
The Resent-Sender header field can be used to specify the sender of the message. Reference: https://www.iana.org/go/rfc5322
ResentTo
§Resent-To
The Resent-To header field can be used to specify the recipients of the message. Reference: https://www.iana.org/go/rfc5322
ReturnPath
§Return-Path
The Return-Path header field can be used to specify the return path for the message. Reference: https://www.iana.org/go/rfc5321
Sender
§Sender
The Sender header field can be used to specify the sender of the message. Reference: https://www.iana.org/go/rfc5322
Sensitivity
§Sensitivity
The Sensitivity header field can be used to specify the sensitivity of the message. Reference: https://www.iana.org/go/rfc4021
Solicitation
§Solicitation
The Solicitation header field can be used to specify the solicitation for the message. Reference: https://www.iana.org/go/rfc3865
Subject
§Subject
The Subject header field can be used to specify the subject of the message. Reference: https://www.iana.org/go/rfc5322
Supersedes
§Supersedes
The Supersedes header field can be used to specify the message that this message supersedes. Reference: https://www.iana.org/go/rfc4021
TLSReportDomain
§TLS-Report-Domain
The TLS-Report-Domain header field can be used to specify the domain for the TLS report. Reference: https://www.iana.org/go/rfc8460
TLSReportSubmitter
§TLS-Report-Domain
The TLS-Report-Domain header field can be used to specify the domain for the TLS report. Reference: https://www.iana.org/go/rfc8460
TLSRequired
§TLS-Required
The TLS-Required header field can be used to specify that TLS is required for the message. Reference: https://www.iana.org/go/rfc8689
To
§To
The To header field can be used to specify the recipients of the message. Reference: https://www.iana.org/go/rfc5322
VBRInfo
§VBR-Info
The VBR-Info header field can be used to specify the VBR information for the message. Reference: https://www.iana.org/go/rfc5518
X400ContentIdentifier
§X400-Content-Identifier
The X400-Content-Identifier header field can be used to specify the content identifier for the message. Reference: https://www.iana.org/go/rfc4021
X400ContentReturn
§X400-Content-Return
The X400-Content-Return header field can be used to specify the return address for non-delivery reports. Reference: https://www.iana.org/go/rfc4021
X400ContentType
§X400-Content-Type
The X400-Content-Type header field can be used to specify the content type of the message. Reference: https://www.iana.org/go/rfc4021
X400MTSIdentifier
§X400-MTS-Identifier
The X400-MTS-Identifier header field can be used to specify the MTS identifier for the message. Reference: https://www.iana.org/go/rfc4021
X400Originator
§X400-Originator
The X400-Originator header field can be used to specify the originator of the message. Reference: https://www.iana.org/go/rfc4021
X400Received
§X400-Received
The X400-Received header field can be used to specify the received information for the message. Reference: https://www.iana.org/go/rfc4021
X400Recipients
§X400-Recipients
The X400-Recipients header field can be used to specify the recipients of the message. Reference: https://www.iana.org/go/rfc4021
X400Trace
§X400-Trace
The X400-Trace header field can be used to specify the trace information for the message. Reference: https://www.iana.org/go/rfc4021
Unknown(String)
§Unknown
The Unknown header field can be used to specify an unknown header.
Implementations§
Source§impl EmailHeaders
§Email Headers Implementation
This implementation is for the EmailHeaders enum.
impl EmailHeaders
§Email Headers Implementation
This implementation is for the EmailHeaders enum.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, String>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, String>
§From Bytes
This function creates a new EmailHeaders from bytes.
Sourcepub fn to_string(&self) -> &str
pub fn to_string(&self) -> &str
§To String
This function converts the email header to a string.
Sourcepub fn from_string(s: &str) -> Self
pub fn from_string(s: &str) -> Self
§From String
This function creates a new EmailHeaders from a string.
Trait Implementations§
Source§impl Clone for EmailHeaders
impl Clone for EmailHeaders
Source§fn clone(&self) -> EmailHeaders
fn clone(&self) -> EmailHeaders
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EmailHeaders
impl Debug for EmailHeaders
Source§impl<'de> Deserialize<'de> for EmailHeaders
impl<'de> Deserialize<'de> for EmailHeaders
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for EmailHeaders
impl Display for EmailHeaders
Source§impl FromStr for EmailHeaders
impl FromStr for EmailHeaders
Source§impl Hash for EmailHeaders
impl Hash for EmailHeaders
Source§impl Ord for EmailHeaders
impl Ord for EmailHeaders
Source§fn cmp(&self, other: &EmailHeaders) -> Ordering
fn cmp(&self, other: &EmailHeaders) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for EmailHeaders
impl PartialEq for EmailHeaders
Source§impl PartialOrd for EmailHeaders
impl PartialOrd for EmailHeaders
Source§impl Serialize for EmailHeaders
impl Serialize for EmailHeaders
impl Eq for EmailHeaders
impl StructuralPartialEq for EmailHeaders
Auto Trait Implementations§
impl Freeze for EmailHeaders
impl RefUnwindSafe for EmailHeaders
impl Send for EmailHeaders
impl Sync for EmailHeaders
impl Unpin for EmailHeaders
impl UnwindSafe for EmailHeaders
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more