1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

add convenienece method to get java InternetAddress from a MailAddress

This commit is contained in:
Kevin Glynn 2012-02-08 11:49:55 +01:00
parent addcb8fc40
commit e4dc32576c
2 changed files with 5 additions and 2 deletions

View File

@ -20,6 +20,8 @@
package CS2JNet.System.Net.Mail; package CS2JNet.System.Net.Mail;
import java.io.UnsupportedEncodingException;
import javax.mail.internet.AddressException; import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress; import javax.mail.internet.InternetAddress;
@ -53,6 +55,9 @@ public class MailAddress {
displayName = inInternetAddress.getPersonal(); displayName = inInternetAddress.getPersonal();
} }
public InternetAddress toInternetAddress() throws UnsupportedEncodingException {
return new InternetAddress(address, displayName);
}
/** /**
* @param displayName the displayName to set * @param displayName the displayName to set

View File

@ -1,7 +1,5 @@
package CS2JNet.System.Net.Mail; package CS2JNet.System.Net.Mail;
import java.util.ArrayList;
import javax.mail.internet.InternetAddress;
public class MailMessage public class MailMessage
{ {