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:
parent
addcb8fc40
commit
e4dc32576c
@ -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
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user