Table of Contents

Class EmailAddress

Namespace
MailForge.Models
Assembly
MailForge.dll

Represents an email address with an optional display name.

public sealed class EmailAddress : IEquatable<EmailAddress>
Inheritance
EmailAddress
Implements
Inherited Members

Constructors

EmailAddress(string, string?)

Creates an email address.

public EmailAddress(string address, string? displayName = null)

Parameters

address string
displayName string

Properties

Address

The raw email address (for example, "john@example.com").

public string Address { get; }

Property Value

string

DisplayName

An optional display name shown next to the address.

public string? DisplayName { get; }

Property Value

string

Methods

Equals(EmailAddress?)

Returns true if this address equals another by comparing both components.

public bool Equals(EmailAddress? other)

Parameters

other EmailAddress

Returns

bool

Equals(object?)

Returns true if this address equals another object.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Returns a hash code for this address.

public override int GetHashCode()

Returns

int

ToString()

Returns "Display Name <address>" when a display name is set, otherwise the address.

public override string ToString()

Returns

string