Class Email
Email entity (also known as EmailDto). When an SMTP email message is received by MailSlurp it is parsed. The body and attachments are written to disk and the fields such as to, from, subject etc are stored in a database. The body contains the email content. If you want the original SMTP message see the getRawEmail endpoints. The attachments can be fetched using the AttachmentController
Implements
Inherited Members
Namespace: mailslurp.Model
Assembly: mailslurp.dll
Syntax
[DataContract(Name = "Email")]
public class Email : IValidatableObject
Constructors
View SourceEmail()
Initializes a new instance of the Email class.
Declaration
[JsonConstructor]
protected Email()
Email(Guid, Guid, Guid, Guid?, List<string>, string, Sender, EmailRecipients, string, List<string>, List<string>, Dictionary<string, string>, Dictionary<string, List<string>>, List<string>, string, string, string, string, string, bool?, string, EmailAnalysis, DateTime, DateTime, bool, bool, bool?, List<string>, string, string, Guid?, string, bool?, long?, bool, bool)
Initializes a new instance of the Email class.
Declaration
public Email(Guid id = default, Guid userId = default, Guid inboxId = default, Guid? domainId = null, List<string> to = null, string from = null, Sender sender = null, EmailRecipients recipients = null, string replyTo = null, List<string> cc = null, List<string> bcc = null, Dictionary<string, string> headers = null, Dictionary<string, List<string>> headersMap = null, List<string> attachments = null, string subject = null, string body = null, string bodyExcerpt = null, string textExcerpt = null, string bodyMD5Hash = null, bool? isHTML = null, string charset = null, EmailAnalysis analysis = null, DateTime createdAt = default, DateTime updatedAt = default, bool read = false, bool teamAccess = false, bool? isXAmpHtml = null, List<string> bodyPartContentTypes = null, string externalId = null, string messageId = null, Guid? threadId = null, string inReplyTo = null, bool? favourite = null, long? sizeBytes = null, bool html = false, bool xampHtml = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | ID of the email entity (required). |
| Guid | userId | ID of user that email belongs to (required). |
| Guid | inboxId | ID of the inbox that received the email (required). |
| Guid? | domainId | ID of the domain that received the email. |
| List<string> | to | List of |
| string | from | Who the email was sent from. An email address - see fromName for the sender name.. |
| Sender | sender | sender. |
| EmailRecipients | recipients | recipients. |
| string | replyTo | The |
| List<string> | cc | List of |
| List<string> | bcc | List of |
| Dictionary<string, string> | headers | Collection of SMTP headers attached to email. |
| Dictionary<string, List<string>> | headersMap | Multi-value map of SMTP headers attached to email. |
| List<string> | attachments | List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension.. |
| string | subject | The subject line of the email message as specified by SMTP subject header. |
| string | body | The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests.. |
| string | bodyExcerpt | An excerpt of the body of the email message for quick preview. Takes HTML content part if exists falls back to TEXT content part if not. |
| string | textExcerpt | An excerpt of the body of the email message for quick preview. Takes TEXT content part if exists. |
| string | bodyMD5Hash | A hash signature of the email message using MD5. Useful for comparing emails without fetching full body.. |
| bool? | isHTML | Is the email body content type HTML?. |
| string | charset | Detected character set of the email body such as UTF-8. |
| EmailAnalysis | analysis | analysis. |
| DateTime | createdAt | When was the email received by MailSlurp (required). |
| DateTime | updatedAt | When was the email last updated (required). |
| bool | read | Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks. (required). |
| bool | teamAccess | Can the email be accessed by organization team members (required). |
| bool? | isXAmpHtml | Is the email body content type x-amp-html Amp4Email?. |
| List<string> | bodyPartContentTypes | A list of detected multipart mime message body part content types such as text/plain and text/html. Can be used with email bodyPart endpoints to fetch individual body parts.. |
| string | externalId | UID used by external IMAP server to identify email. |
| string | messageId | RFC 5322 Message-ID header value without angle brackets.. |
| Guid? | threadId | MailSlurp thread ID for email chain that enables lookup for In-Reply-To and References fields.. |
| string | inReplyTo | Parsed value of In-Reply-To header. A Message-ID in a thread.. |
| bool? | favourite | Is email favourited. |
| long? | sizeBytes | Size of raw email message in bytes. |
| bool | html | html. |
| bool | xampHtml | xampHtml. |
Properties
View SourceAnalysis
Gets or Sets Analysis
Declaration
[DataMember(Name = "analysis", EmitDefaultValue = true)]
public EmailAnalysis Analysis { get; set; }
Property Value
| Type | Description |
|---|---|
| EmailAnalysis |
Attachments
List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension.
Declaration
[DataMember(Name = "attachments", EmitDefaultValue = true)]
public List<string> Attachments { get; set; }
Property Value
| Type | Description |
|---|---|
| List<string> | List of IDs of attachments found in the email. Use these IDs with the Inbox and Email Controllers to download attachments and attachment meta data such as filesize, name, extension. |
Bcc
List of BCC recipients email addresses that the email was addressed to. See recipients object for names.
Declaration
[DataMember(Name = "bcc", EmitDefaultValue = true)]
public List<string> Bcc { get; set; }
Property Value
| Type | Description |
|---|---|
| List<string> | List of |
Body
The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests.
Declaration
[DataMember(Name = "body", EmitDefaultValue = true)]
public string Body { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The body of the email message as text parsed from the SMTP message body (does not include attachments). Fetch the raw content to access the SMTP message and use the attachments property to access attachments. The body is stored separately to the email entity so the body is not returned in paginated results only in full single email or wait requests. |
BodyExcerpt
An excerpt of the body of the email message for quick preview. Takes HTML content part if exists falls back to TEXT content part if not
Declaration
[DataMember(Name = "bodyExcerpt", EmitDefaultValue = true)]
public string BodyExcerpt { get; set; }
Property Value
| Type | Description |
|---|---|
| string | An excerpt of the body of the email message for quick preview. Takes HTML content part if exists falls back to TEXT content part if not |
BodyMD5Hash
A hash signature of the email message using MD5. Useful for comparing emails without fetching full body.
Declaration
[DataMember(Name = "bodyMD5Hash", EmitDefaultValue = true)]
public string BodyMD5Hash { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A hash signature of the email message using MD5. Useful for comparing emails without fetching full body. |
BodyPartContentTypes
A list of detected multipart mime message body part content types such as text/plain and text/html. Can be used with email bodyPart endpoints to fetch individual body parts.
Declaration
[DataMember(Name = "bodyPartContentTypes", EmitDefaultValue = true)]
public List<string> BodyPartContentTypes { get; set; }
Property Value
| Type | Description |
|---|---|
| List<string> | A list of detected multipart mime message body part content types such as text/plain and text/html. Can be used with email bodyPart endpoints to fetch individual body parts. |
Cc
List of CC recipients email addresses that the email was addressed to. See recipients object for names.
Declaration
[DataMember(Name = "cc", EmitDefaultValue = true)]
public List<string> Cc { get; set; }
Property Value
| Type | Description |
|---|---|
| List<string> | List of |
Charset
Detected character set of the email body such as UTF-8
Declaration
[DataMember(Name = "charset", EmitDefaultValue = true)]
public string Charset { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Detected character set of the email body such as UTF-8 |
CreatedAt
When was the email received by MailSlurp
Declaration
[DataMember(Name = "createdAt", IsRequired = true, EmitDefaultValue = true)]
public DateTime CreatedAt { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime | When was the email received by MailSlurp |
DomainId
ID of the domain that received the email
Declaration
[DataMember(Name = "domainId", EmitDefaultValue = true)]
public Guid? DomainId { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid? | ID of the domain that received the email |
ExternalId
UID used by external IMAP server to identify email
Declaration
[DataMember(Name = "externalId", EmitDefaultValue = true)]
public string ExternalId { get; set; }
Property Value
| Type | Description |
|---|---|
| string | UID used by external IMAP server to identify email |
Favourite
Is email favourited
Declaration
[DataMember(Name = "favourite", EmitDefaultValue = true)]
public bool? Favourite { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? | Is email favourited |
From
Who the email was sent from. An email address - see fromName for the sender name.
Declaration
[DataMember(Name = "from", EmitDefaultValue = true)]
public string From { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Who the email was sent from. An email address - see fromName for the sender name. |
Headers
Collection of SMTP headers attached to email
Declaration
[DataMember(Name = "headers", EmitDefaultValue = true)]
[Obsolete]
public Dictionary<string, string> Headers { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> | Collection of SMTP headers attached to email |
HeadersMap
Multi-value map of SMTP headers attached to email
Declaration
[DataMember(Name = "headersMap", EmitDefaultValue = true)]
public Dictionary<string, List<string>> HeadersMap { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, List<string>> | Multi-value map of SMTP headers attached to email |
Html
Gets or Sets Html
Declaration
[DataMember(Name = "html", EmitDefaultValue = true)]
public bool Html { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Id
ID of the email entity
Declaration
[DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)]
public Guid Id { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid | ID of the email entity |
InReplyTo
Parsed value of In-Reply-To header. A Message-ID in a thread.
Declaration
[DataMember(Name = "inReplyTo", EmitDefaultValue = true)]
public string InReplyTo { get; set; }
Property Value
| Type | Description |
|---|---|
| string | Parsed value of In-Reply-To header. A Message-ID in a thread. |
InboxId
ID of the inbox that received the email
Declaration
[DataMember(Name = "inboxId", IsRequired = true, EmitDefaultValue = true)]
public Guid InboxId { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid | ID of the inbox that received the email |
IsHTML
Is the email body content type HTML?
Declaration
[DataMember(Name = "isHTML", EmitDefaultValue = true)]
public bool? IsHTML { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? | Is the email body content type HTML? |
IsXAmpHtml
Is the email body content type x-amp-html Amp4Email?
Declaration
[DataMember(Name = "isXAmpHtml", EmitDefaultValue = true)]
public bool? IsXAmpHtml { get; set; }
Property Value
| Type | Description |
|---|---|
| bool? | Is the email body content type x-amp-html Amp4Email? |
MessageId
RFC 5322 Message-ID header value without angle brackets.
Declaration
[DataMember(Name = "messageId", EmitDefaultValue = true)]
public string MessageId { get; set; }
Property Value
| Type | Description |
|---|---|
| string | RFC 5322 Message-ID header value without angle brackets. |
Read
Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks.
Declaration
[DataMember(Name = "read", IsRequired = true, EmitDefaultValue = true)]
public bool Read { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | Read flag. Has the email ever been viewed in the dashboard or fetched via the API with a hydrated body? If so the email is marked as read. Paginated results do not affect read status. Read status is different to email opened event as it depends on your own account accessing the email. Email opened is determined by tracking pixels sent to other uses if enable during sending. You can listened for both email read and email opened events using webhooks. |
Recipients
Gets or Sets Recipients
Declaration
[DataMember(Name = "recipients", EmitDefaultValue = true)]
public EmailRecipients Recipients { get; set; }
Property Value
| Type | Description |
|---|---|
| EmailRecipients |
ReplyTo
The replyTo field on the received email message
Declaration
[DataMember(Name = "replyTo", EmitDefaultValue = true)]
public string ReplyTo { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The |
Sender
Gets or Sets Sender
Declaration
[DataMember(Name = "sender", EmitDefaultValue = true)]
public Sender Sender { get; set; }
Property Value
| Type | Description |
|---|---|
| Sender |
SizeBytes
Size of raw email message in bytes
Declaration
[DataMember(Name = "sizeBytes", EmitDefaultValue = true)]
public long? SizeBytes { get; set; }
Property Value
| Type | Description |
|---|---|
| long? | Size of raw email message in bytes |
Subject
The subject line of the email message as specified by SMTP subject header
Declaration
[DataMember(Name = "subject", EmitDefaultValue = true)]
public string Subject { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The subject line of the email message as specified by SMTP subject header |
TeamAccess
Can the email be accessed by organization team members
Declaration
[DataMember(Name = "teamAccess", IsRequired = true, EmitDefaultValue = true)]
public bool TeamAccess { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | Can the email be accessed by organization team members |
TextExcerpt
An excerpt of the body of the email message for quick preview. Takes TEXT content part if exists
Declaration
[DataMember(Name = "textExcerpt", EmitDefaultValue = true)]
public string TextExcerpt { get; set; }
Property Value
| Type | Description |
|---|---|
| string | An excerpt of the body of the email message for quick preview. Takes TEXT content part if exists |
ThreadId
MailSlurp thread ID for email chain that enables lookup for In-Reply-To and References fields.
Declaration
[DataMember(Name = "threadId", EmitDefaultValue = true)]
public Guid? ThreadId { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid? | MailSlurp thread ID for email chain that enables lookup for In-Reply-To and References fields. |
To
List of To recipient email addresses that the email was addressed to. See recipients object for names.
Declaration
[DataMember(Name = "to", IsRequired = true, EmitDefaultValue = true)]
public List<string> To { get; set; }
Property Value
| Type | Description |
|---|---|
| List<string> | List of |
UpdatedAt
When was the email last updated
Declaration
[DataMember(Name = "updatedAt", IsRequired = true, EmitDefaultValue = true)]
public DateTime UpdatedAt { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime | When was the email last updated |
UserId
ID of user that email belongs to
Declaration
[DataMember(Name = "userId", IsRequired = true, EmitDefaultValue = true)]
public Guid UserId { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid | ID of user that email belongs to |
XampHtml
Gets or Sets XampHtml
Declaration
[DataMember(Name = "xampHtml", EmitDefaultValue = true)]
public bool XampHtml { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceToJson()
Returns the JSON string presentation of the object
Declaration
public virtual string ToJson()
Returns
| Type | Description |
|---|---|
| string | JSON string presentation of the object |
ToString()
Returns the string presentation of the object
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | String presentation of the object |