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

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

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

MimeMessage.setOrRemoveHeader介绍

[英]Conditionally set or remove a named header. If the new value is null, the header is removed.
[中]有条件地设置或删除命名标头。如果新值为null,则删除标头。

代码示例

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec

public void setContentID(String cid) throws MessagingException {
  setOrRemoveHeader("Content-ID", cid);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec

public void setContentMD5(String md5) throws MessagingException {
  setOrRemoveHeader("Content-MD5", md5);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec

public void setContentID(String cid) throws MessagingException {
  setOrRemoveHeader("Content-ID", cid);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec

public void setContentMD5(String md5) throws MessagingException {
  setOrRemoveHeader("Content-MD5", md5);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec

/**
 * Set the message sent date.  This updates the "Date" header.
 * If the provided date is null, the header is removed.
 *
 * @param sent   The new sent date value.
 *
 * @exception MessagingException
 */
public void setSentDate(Date sent) throws MessagingException {
  setOrRemoveHeader("Date", dateFormat.format(sent));
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec

/**
 * Set a recipient field to a string address (which may be a
 * list or group type).
 *
 * If the address is null, the field is removed.
 *
 * @param type    The type of recipient to set.
 * @param address The address string.
 *
 * @exception MessagingException
 */
public void setRecipients(Message.RecipientType type, String address) throws MessagingException {
  setOrRemoveHeader(getHeaderForRecipientType(type), address);
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec

/**
 * Set the message sent date.  This updates the "Date" header.
 * If the provided date is null, the header is removed.
 *
 * @param sent   The new sent date value.
 *
 * @exception MessagingException
 */
public void setSentDate(Date sent) throws MessagingException {
  setOrRemoveHeader("Date", dateFormat.format(sent));
}

代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec

/**
 * Set a recipient field to a string address (which may be a
 * list or group type).
 *
 * If the address is null, the field is removed.
 *
 * @param type    The type of recipient to set.
 * @param address The address string.
 *
 * @exception MessagingException
 */
public void setRecipients(Message.RecipientType type, String address) throws MessagingException {
  setOrRemoveHeader(getHeaderForRecipientType(type), address);
}

相关文章

MimeMessage类方法