goog.format.EmailAddress
Classgoog.format.EmailAddress(opt_address, opt_name)
Formats an email address string for display, and allows for extraction of The individual componants of the address.
opt_address
{string
=}
opt_name
{string
=}
.getAddress()
Get the email address.
string
}
.getName()
Get the name associated with the email address.
string
}
.isValid()
Determines is the current object is a valid email address.
boolean
}
.isValidAddrSpec(str)
Checks if the provided string is a valid address spec (local@domain.com).
str
{string
}
boolean
}
.isValidAddress(str)
Checks if the provided string is a valid email address. Supports both simple email addresses (address specs) and addresses that contain display names.
str
{string
}
boolean
}
.parse(addr)
Parse an email address of the form "name" <address> into an email address.
addr
{string
}
goog.format.EmailAddress
}
.parseList(str)
Parse a string containing email addresses of the form "name" <address> into an array of email addresses.
str
{string
}
Array
.<goog.format.EmailAddress
>}
.setAddress(address)
Set the email address.
address
{string
}
.setName(name)
Set the name associated with the email address.
name
{string
}
.toString()
Return the address in a standard format: - remove extra spaces. - Surround name with quotes if it contains special characters.
string
}