InternetMessageFormatHeader

public struct InternetMessageFormatHeader : Equatable

Representation of the email headers formatted under the RFC-6854 (supersedes RFC 822) standard. Some further rules (beyond RFC 6854) must also be applied to the data:

  • At least one recipient must exist (to, cc, bcc).
  • For all email addresses:
    • Total length (including both local part and domain) must not exceed 256 characters.
    • Local part must not exceed more than 64 characters.
    • Input domain parts (domain separated by .) must not exceed 63 characters.
    • Address must match standard email address pattern: ^[a-zA-Z0-9](\.?[-_a-zA-Z0-9])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$.
  • The email address belonging to the sender.

    Declaration

    Swift

    public let from: EmailAddressAndName
  • to

    The email addresses belonging to the primary recipients.

    Declaration

    Swift

    public let to: [EmailAddressAndName]
  • cc

    The email addresses belonging to the secondary recipients.

    Declaration

    Swift

    public let cc: [EmailAddressAndName]
  • bcc

    The email addresses belonging to additional recipients.

    Declaration

    Swift

    public let bcc: [EmailAddressAndName]
  • The email addresses in which responses are to be sent.

    Declaration

    Swift

    public let replyTo: [EmailAddressAndName]
  • The subject line of the email message.

    Declaration

    Swift

    public let subject: String
  • Initialize an instance of InternetMessageFormatHeader.

    Declaration

    Swift

    public init(
        from: EmailAddressAndName,
        to: [EmailAddressAndName] = [],
        cc: [EmailAddressAndName] = [],
        bcc: [EmailAddressAndName] = [],
        replyTo: [EmailAddressAndName] = [],
        subject: String
    )