|
Answer» Address class is ALSO an abstract class so we will use here class javax.mail.internet.InternetAddress. Address address = new InternetAddress("arindam@withoutbook.com"); To display a name next to the Email Address use ONE more ARGUMENT for name. Address address = new InternetAddress("arindam@withoutbook.com", "Arindam");
After creating address CONNECT with message by two ways:
1: By setFrom()method: message.setFrom(address); 1: By setReplyTo()method: When want to send reply to more addresses. Address address[] = ...; Message.setReplyTo(address[]); To IDENTIFY the recipient, add the recipients 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
Address class is also an abstract class so we will use here class javax.mail.internet.InternetAddress. Address address = new InternetAddress("arindam@withoutbook.com"); To display a name next to the Email Address use one more argument for name. Address address = new InternetAddress("arindam@withoutbook.com", "Arindam"); After creating address connect with message by two ways: 1: By setFrom()method: message.setFrom(address); 1: By setReplyTo()method: When want to send reply to more addresses. Address address[] = ...; Message.setReplyTo(address[]); To identify the recipient, add the recipients by using addRecipient() method…. message.addRecipient(type, address); Address types are of three types:
|