io.vertx.ext.mail.mailencoder

## Class EmailAddress

- java.lang.Object
- - io.vertx.ext.mail.mailencoder.EmailAddress

-     public class EmailAddress
      extends Object

  represent a mail address with an email address part and an optional full name e.g.
  `user@example.com`
  `user@example.com (This User)`
  `Another User <other@example.net>`

  the constructor will validate the address catching format errors like excess spaces, newlines the test is not very strict, for example an IDN address will be considered valid, even though SMTP doesn't work with that yet

  Author:
    Alexander Lehmann

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `POSTMASTER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmailAddress(String fullAddress)` parse and create an email address

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getEmail()` get the email part of the address
    `String` | `getName()` get the name part of the address
    `String` | `toString()` get a representation of the address (this is mostly for testing)

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### POSTMASTER

          public static final String POSTMASTER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### EmailAddress

          public EmailAddress(String fullAddress)

      parse and create an email address
      Parameters:
        `fullAddress` - full address string
      Throws:
        `IllegalArgumentException` - if an address is not valid

  - ### Method Detail

    - #### getEmail

          public String getEmail()

      get the email part of the address
      Returns:
        the email

    - #### getName

          public String getName()

      get the name part of the address
      Returns:
        the full name

    - #### toString

          public String toString()

      get a representation of the address (this is mostly for testing)
      Overrides:
        `toString` in class `Object`
      Returns:
        representation of the address

Copyright © 2024 Eclipse. All rights reserved.