Skip to contents

Create an address object which represents an email address.

Usage

address(
  email = NA,
  display = NA,
  local = NA,
  domain = NA,
  normalise = TRUE,
  validate = FALSE
)

Arguments

email

Email address.

display

Display name.

local

Local part of email address.

domain

Domain part of email address.

normalise

Whether to try to normalise address to RFC-5321 requirements.

validate

Whether to validate the address.

Value

An address object, representing an email address.

Examples

address("gerry@gmail.com")
#> [1] "gerry@gmail.com"
address("gerry@gmail.com", "Gerald")
#> [1] "Gerald <gerry@gmail.com>"
address("gerry@gmail.com", "Gerald Durrell")
#> [1] "Gerald Durrell <gerry@gmail.com>"
# Display name in "Last, First" format.
address("gerry@gmail.com", "Durrell, Gerald")
#> [1] "Durrell, Gerald <gerry@gmail.com>"
# Display name contains non-ASCII characters.
address("hans@gmail.com", "Hansjörg Müller")
#> [1] "Hansjörg Müller <hans@gmail.com>"