Search Results for

    Show / Hide Table of Contents
    View Source

    Class EmailMessage

    Represents an email message with sender, recipients, subject, body, and optional attachments.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Models.Email
    Assembly: Umbraco.Core.dll
    Syntax
    public class EmailMessage

    Constructors

    View Source

    EmailMessage(string?, string?, string?, string?, bool)

    Initializes a new instance of the EmailMessage class with a single recipient.

    Declaration
    public EmailMessage(string? from, string? to, string? subject, string? body, bool isBodyHtml)
    Parameters
    Type Name Description
    string from

    The sender's email address.

    string to

    The recipient's email address.

    string subject

    The email subject.

    string body

    The email body content.

    bool isBodyHtml

    A value indicating whether the body is HTML formatted.

    View Source

    EmailMessage(string?, string?[], string[]?, string[]?, string[]?, string?, string?, bool, IEnumerable<EmailMessageAttachment>?)

    Initializes a new instance of the EmailMessage class with multiple recipients and optional CC, BCC, and reply-to addresses.

    Declaration
    public EmailMessage(string? from, string?[] to, string[]? cc, string[]? bcc, string[]? replyTo, string? subject, string? body, bool isBodyHtml, IEnumerable<EmailMessageAttachment>? attachments)
    Parameters
    Type Name Description
    string from

    The sender's email address.

    string[] to

    The array of recipient email addresses.

    string[] cc

    The array of CC email addresses.

    string[] bcc

    The array of BCC email addresses.

    string[] replyTo

    The array of reply-to email addresses.

    string subject

    The email subject.

    string body

    The email body content.

    bool isBodyHtml

    A value indicating whether the body is HTML formatted.

    IEnumerable<EmailMessageAttachment> attachments

    The collection of email attachments.

    Properties

    View Source

    Attachments

    Gets the collection of email attachments.

    Declaration
    public IList<EmailMessageAttachment>? Attachments { get; }
    Property Value
    Type Description
    IList<EmailMessageAttachment>
    View Source

    Bcc

    Gets the array of BCC email addresses.

    Declaration
    public string[]? Bcc { get; }
    Property Value
    Type Description
    string[]
    View Source

    Body

    Gets the email body content.

    Declaration
    public string? Body { get; }
    Property Value
    Type Description
    string
    View Source

    Cc

    Gets the array of CC email addresses.

    Declaration
    public string[]? Cc { get; }
    Property Value
    Type Description
    string[]
    View Source

    From

    Gets the sender's email address.

    Declaration
    public string? From { get; }
    Property Value
    Type Description
    string
    View Source

    HasAttachments

    Gets a value indicating whether the email has any attachments.

    Declaration
    public bool HasAttachments { get; }
    Property Value
    Type Description
    bool
    View Source

    IsBodyHtml

    Gets a value indicating whether the body is HTML formatted.

    Declaration
    public bool IsBodyHtml { get; }
    Property Value
    Type Description
    bool
    View Source

    ReplyTo

    Gets the array of reply-to email addresses.

    Declaration
    public string[]? ReplyTo { get; }
    Property Value
    Type Description
    string[]
    View Source

    Subject

    Gets the email subject.

    Declaration
    public string? Subject { get; }
    Property Value
    Type Description
    string
    View Source

    To

    Gets the array of recipient email addresses.

    Declaration
    public string?[] To { get; }
    Property Value
    Type Description
    string[]
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX