javax.mail.internet.MimeMessage.setAddressHeader()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(12.9k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中javax.mail.internet.MimeMessage.setAddressHeader()方法的一些代码示例,展示了MimeMessage.setAddressHeader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeMessage.setAddressHeader()方法的具体详情如下:
包路径:javax.mail.internet.MimeMessage
类名称:MimeMessage
方法名:setAddressHeader

MimeMessage.setAddressHeader介绍

暂无

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
@Override
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Set the RFC 822 "From" header field. Any existing values are 
 * replaced with the given addresses. If address is <code>null</code>,
 * this header is removed.
 *
 * @param address    the sender(s) of this message
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @since        JvaMail 1.5
 */
public void setFrom(String address) throws MessagingException {
if (address == null)
  removeHeader("From");
else
  setAddressHeader("From", InternetAddress.parse(address));
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * Set the RFC 822 "From" header field. Any existing values are 
 * replaced with the given addresses. If address is <code>null</code>,
 * this header is removed.
 *
 * @param address    the sender(s) of this message
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @since        JvaMail 1.5
 */
public void setFrom(String address) throws MessagingException {
if (address == null)
  removeHeader("From");
else
  setAddressHeader("From", InternetAddress.parse(address));
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Set the specified recipient type to the given addresses.
 * If the address parameter is <code>null</code>, the corresponding
 * recipient field is removed.
 *   
 * @param type      Recipient type
 * @param addresses Addresses
 * @exception       AddressException if the attempt to parse the
 *                  addresses String fails
 * @exception       IllegalWriteException if the underlying
 *                  implementation does not support modification
 *                  of existing values
 * @exception       IllegalStateException if this message is
 *                  obtained from a READ_ONLY folder.
 * @exception       MessagingException for other failures
 * @see             #getRecipients
 * @since           JavaMail 1.2
 */
public void setRecipients(Message.RecipientType type, String addresses)
              throws MessagingException {
  if (type == RecipientType.NEWSGROUPS) {
    if (addresses == null || addresses.length() == 0)
      removeHeader("Newsgroups");
    else
      setHeader("Newsgroups", addresses);
  } else
    setAddressHeader(getHeaderName(type),
  addresses == null ? null : InternetAddress.parse(addresses));
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * Set the specified recipient type to the given addresses.
 * If the address parameter is <code>null</code>, the corresponding
 * recipient field is removed.
 *   
 * @param type      Recipient type
 * @param addresses Addresses
 * @exception       AddressException if the attempt to parse the
 *                  addresses String fails
 * @exception       IllegalWriteException if the underlying
 *                  implementation does not support modification
 *                  of existing values
 * @exception       IllegalStateException if this message is
 *                  obtained from a READ_ONLY folder.
 * @exception       MessagingException for other failures
 * @see             #getRecipients
 * @since           JavaMail 1.2
 */
public void setRecipients(Message.RecipientType type, String addresses)
              throws MessagingException {
  if (type == RecipientType.NEWSGROUPS) {
    if (addresses == null || addresses.length() == 0)
      removeHeader("Newsgroups");
    else
      setHeader("Newsgroups", addresses);
  } else
    setAddressHeader(getHeaderName(type),
  addresses == null ? null : InternetAddress.parse(addresses));
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Set the specified recipient type to the given addresses.
 * If the address parameter is <code>null</code>, the corresponding
 * recipient field is removed.
 *
 * @param type    Recipient type
 * @param addresses    Addresses
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @see        #getRecipients
 */
public void setRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  if (addresses == null || addresses.length == 0)
  removeHeader("Newsgroups");
  else
  setHeader("Newsgroups", NewsAddress.toString(addresses));
} else
  setAddressHeader(getHeaderName(type), addresses);
}

代码示例来源:origin: com.sun.mail/javax.mail

/**
 * Set the specified recipient type to the given addresses.
 * If the address parameter is <code>null</code>, the corresponding
 * recipient field is removed.
 *
 * @param type    Recipient type
 * @param addresses    Addresses
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @see        #getRecipients
 */
@Override
public void setRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  if (addresses == null || addresses.length == 0)
  removeHeader("Newsgroups");
  else
  setHeader("Newsgroups", NewsAddress.toString(addresses));
} else
  setAddressHeader(getHeaderName(type), addresses);
}

代码示例来源:origin: javax.mail/com.springsource.javax.mail

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException
 */
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax.mail

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException
 */
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: javax.mail/javax.mail-api

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
@Override
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: org.glassfish.metro/webservices-extra

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
@Override
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: com.sun.mail/mailapi

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
@Override
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: jboss/jboss-javaee-specs

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
@Override
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: com.sun.mail/jakarta.mail

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
@Override
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: com.sun.mail/android-mail

/**
 * Set the RFC 822 "Reply-To" header field. If the address 
 * parameter is <code>null</code>, this header is removed.
 *
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 */
@Override
public void setReplyTo(Address[] addresses) throws MessagingException {
setAddressHeader("Reply-To", addresses);
}

代码示例来源:origin: com.sun.mail/jakarta.mail

/**
 * Set the RFC 822 "From" header field. Any existing values are 
 * replaced with the given addresses. If address is <code>null</code>,
 * this header is removed.
 *
 * @param address    the sender(s) of this message
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @since        JvaMail 1.5
 */
public void setFrom(String address) throws MessagingException {
if (address == null)
  removeHeader("From");
else
  setAddressHeader("From", InternetAddress.parse(address));
}

代码示例来源:origin: com.sun.mail/mailapi

/**
 * Set the RFC 822 "From" header field. Any existing values are 
 * replaced with the given addresses. If address is <code>null</code>,
 * this header is removed.
 *
 * @param address    the sender(s) of this message
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @since        JvaMail 1.5
 */
public void setFrom(String address) throws MessagingException {
if (address == null)
  removeHeader("From");
else
  setAddressHeader("From", InternetAddress.parse(address));
}

代码示例来源:origin: org.glassfish.metro/webservices-extra

/**
 * Set the RFC 822 "From" header field. Any existing values are 
 * replaced with the given addresses. If address is <code>null</code>,
 * this header is removed.
 *
 * @param address    the sender(s) of this message
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @since        JvaMail 1.5
 */
public void setFrom(String address) throws MessagingException {
if (address == null)
  removeHeader("From");
else
  setAddressHeader("From", InternetAddress.parse(address));
}

代码示例来源:origin: com.sun.mail/android-mail

/**
 * Set the RFC 822 "From" header field. Any existing values are 
 * replaced with the given addresses. If address is <code>null</code>,
 * this header is removed.
 *
 * @param address    the sender(s) of this message
 * @exception    IllegalWriteException if the underlying
 *            implementation does not support modification
 *            of existing values
 * @exception    IllegalStateException if this message is
 *            obtained from a READ_ONLY folder.
 * @exception    MessagingException for other failures
 * @since        JvaMail 1.5
 */
public void setFrom(String address) throws MessagingException {
if (address == null)
  removeHeader("From");
else
  setAddressHeader("From", InternetAddress.parse(address));
}

相关文章

MimeMessage类方法