AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    Administration interface basicsDevelopers and adminsBusiness usersChangelogGlossary
  • Guides
    Welcome to Xperience by KenticoAdministration interface basicsCustomer journeysDigital marketingConfigurationDevelopmentArchitectureUpgrade to Xperience by Kentico
  • Training
    For AdminsFor Business usersFor DevelopersFor Solution architects
  • API Examples
    ConfigurationContent managementDevelopmentDigital marketing
  • Changelog
    Documentation updatesSecurity advisories
  1. Home
  2. Configuration
  3. Email queue

Email queue


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

List of examples:

  • Dependency injection
    • Initialize required services
    • Send emails

Dependency injection

Initialize required services

C#
// Initializes all services and provider classes used within
// the API examples on this page using dependency injection.
private readonly IEmailService emailService;

public EmailQueueServices(IEmailService emailService)
{
    this.emailService = emailService;
}
> Back to list of examples

Send emails

C#
// Creates the email message object
EmailMessage msg = new EmailMessage()
{
    // Sets the 'From' email address
    From = "system@localhost.local",

    // Sets the 'To' email address
    // Separate addresses with a semicolon ';' to add multiple recipients
    Recipients = "admin@localhost.local",

    // Sets the priority of the email
    // The system prioritizes processing emails with a higher priority
    Priority = EmailPriorityEnum.Normal,

    // Sets the subject line of the email
    Subject = "Hello!",

    // Sets the body of the email
    Body = "Lorem ipsum dolor sit amet...",
};

// Email sending is performed using an instance of 'IEmailService', typically obtained using dependency injection
// Adds the email message to the email queue
// The email is then sent using a configured email client (e.g., an SMTP server or SendGrid)
emailService.SendEmail(msg);
> Back to list of examples