Exemplo n.º 1
0
 @Override
 public void setFrom(Address from) throws MessagingException {
   if (from != null) {
     setHeader("From", from.toEncodedString());
     this.mFrom = new Address[] {from};
   } else {
     this.mFrom = null;
   }
 }
Exemplo n.º 2
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;
   }
 }
Exemplo n.º 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.");
   }
 }