jodd-mail/src/main/java/jodd/mail/EmailAddress.java
public static EmailAddress of(String address) {
		address = address.trim();

		if (!StringUtil.endsWithChar(address, '>')) {
			return new EmailAddress(null, address);
		}

		final int ndx = address.lastIndexOf('<');
		if (ndx == -1) {
			return new EmailAddress(null, address);
		}

		String email = address.substring(ndx + 1, address.length() - 1);
		String personalName = address.substring(0, ndx).trim();
		return new EmailAddress(personalName, email);
	}
public static EmailAddress of(String address) {
		address = address.trim();

		if (!StringUtil.endsWithChar(address, '>')) {
			return new EmailAddress(null, address);
		}

		final int ndx = address.lastIndexOf('<');
		if (ndx == -1) {
			return new EmailAddress(null, address);
		}

		String email = address.substring(ndx + 1, address.length() - 1);
		String personalName = address.substring(0, ndx).trim();
		return new EmailAddress(personalName, email);
	}
public static EmailAddress of ( String address ) { address = address . trim ( ) ; if ( ! StringUtil . endsWithChar ( address , ' ' ) ) { return new EmailAddress ( null , address ) ; } final int ndx = address . lastIndexOf ( ' ' ) ; if ( ndx == - 1 ) { return new EmailAddress ( null , address ) ; } String email = address . substring ( ndx + 1 , address . length ( ) - 1 ) ; String personalName = address . substring ( 0 , ndx ) . trim ( ) ; return new EmailAddress ( personalName , email ) ; }
Creates new address by specifying one of the following:
<ul>
<li>{@code "foo@bar.com" - only email address.}</li>
<li>{@code "Jenny Doe &lt;foo@bar.com&gt;" - first part of the string is personal name,
and the other part is email, surrounded with < and >.}</li>
</ul>

@param address {@link String} containing address to convert.
Creates new address by specifying one of the following : <ul > <li > { @code foo@bar . com - only email address . } < / li > <li > { @code Jenny Doe &lt ; foo@bar . com&gt ; - first part of the string is personal name and the other part is email surrounded with < and > . } < / li > < / ul >