Example #1
0
 @Override
 public void setReplyTo(Address[] replyTo) throws MessagingException {
   if (replyTo == null || replyTo.length == 0) {
     removeHeader("Reply-to");
     mReplyTo = null;
   } else {
     setHeader("Reply-to", Address.toEncodedString(replyTo));
     mReplyTo = replyTo;
   }
 }
Example #2
0
 @Override
 public void setSentDate(Date sentDate) throws MessagingException {
   removeHeader("Date");
   addSentDate(sentDate);
 }
Example #3
-1
 @Override
 public void setRecipients(RecipientType type, Address[] addresses) throws MessagingException {
   if (type == RecipientType.TO) {
     if (addresses == null || addresses.length == 0) {
       removeHeader("To");
       this.mTo = null;
     } else {
       setHeader("To", Address.toEncodedString(addresses));
       this.mTo = addresses;
     }
   } else if (type == RecipientType.CC) {
     if (addresses == null || addresses.length == 0) {
       removeHeader("CC");
       this.mCc = null;
     } else {
       setHeader("CC", Address.toEncodedString(addresses));
       this.mCc = addresses;
     }
   } else if (type == RecipientType.BCC) {
     if (addresses == null || addresses.length == 0) {
       removeHeader("BCC");
       this.mBcc = null;
     } else {
       setHeader("BCC", Address.toEncodedString(addresses));
       this.mBcc = addresses;
     }
   } else {
     throw new MessagingException("Unrecognized recipient type.");
   }
 }