Address
public struct Address : Encodable
The Address struct represents an email address and contains the email
address along with an optional display name.
-
An optional name to display instead of the email address.
Declaration
Swift
public let name: String? -
An email address.
Declaration
Swift
public let email: String
-
Initializes the address with an email address and an optional display name.
Declaration
Swift
public init(email: String, name: String? = nil)Parameters
emailThe email address.
nameAn optional display name.
-
Validates that the email address is an RFC compliant email address.
Declaration
Swift
public func validate() throws
-
This initializer allows you to create an
Addressinstance from aString:let address: Address = "foo@bar.none"Declaration
Swift
public init(stringLiteral value: String)Parameters
valueThe email address to use in the
Address.
View on GitHub
Address Structure Reference