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

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

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

MimeMessage.addAddressHeader介绍

暂无

代码示例

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
@Override
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 * 
 * @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
 * @since           JavaMail 1.2
 */
public void addRecipients(Message.RecipientType type, String addresses)
              throws MessagingException {
  if (type == RecipientType.NEWSGROUPS) {
    if (addresses != null && addresses.length() != 0)
      addHeader("Newsgroups", addresses);
  } else
    addAddressHeader(getHeaderName(type),
    InternetAddress.parse(addresses));
}

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

/**
 * Add the given addresses to the specified recipient type.
 * 
 * @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
 * @since           JavaMail 1.2
 */
public void addRecipients(Message.RecipientType type, String addresses)
              throws MessagingException {
  if (type == RecipientType.NEWSGROUPS) {
    if (addresses != null && addresses.length() != 0)
      addHeader("Newsgroups", addresses);
  } else
    addAddressHeader(getHeaderName(type),
    InternetAddress.parse(addresses));
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
@Override
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
@Override
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
@Override
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
@Override
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
@Override
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
@Override
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the specified addresses to the existing "From" field. If
 * the "From" field does not already exist, it is created.
 *
 * @param addresses    the senders 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
 */
@Override
public void addFrom(Address[] addresses) throws MessagingException {
addAddressHeader("From", addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
@Override
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
@Override
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
@Override
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

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

/**
 * Add the given addresses to the specified recipient type.
 *
 * @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
 */
@Override
public void addRecipients(Message.RecipientType type, Address[] addresses)
              throws MessagingException {
if (type == RecipientType.NEWSGROUPS) {
  String s = NewsAddress.toString(addresses);
  if (s != null)
  addHeader("Newsgroups", s);
} else
  addAddressHeader(getHeaderName(type), addresses);
}

相关文章

MimeMessage类方法