View RSS Feed

Java Mail

Java Mail API Address

Rate this Entry
by , 04-25-2012 at 10:54 PM (1119 Views)
Address class is considered to be the abstract class hence class javax.mail.internet.InternetAddress will be used here.

Address address = new InternetAddress("");

For name text to be displayed to Email add, one or more arguments shall be used for the name

Java Code:
Address address = new InternetAddress(“”, ”name”);
After address has been created, make connection with message by 2 ways:

1: By setFrom()method: message.setFrom(address);
2: By setReplyTo()method: When want to send reply to more addresses.

Java Code:
Address address[] = ...;
Recipients could be identified when recipients are added by using addRecipient() method….

message.addRecipient(type, address);
Address types are of three types:
* Message.RecipientType.TO: primary recipient
* Message.RecipientType.CC: carbon copy
* Message.RecipientType.BCC: blind carbon copy

Submit "Java Mail API Address" to Facebook Submit "Java Mail API Address" to Digg Submit "Java Mail API Address" to Submit "Java Mail API Address" to StumbleUpon Submit "Java Mail API Address" to Google

Mail API