本文整理了Java中javax.mail.internet.MimeMessage.setDisposition()
方法的一些代码示例,展示了MimeMessage.setDisposition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MimeMessage.setDisposition()
方法的具体详情如下:
包路径:javax.mail.internet.MimeMessage
类名称:MimeMessage
方法名:setDisposition
[英]Set the disposition in the "Content-Disposition" header field of this body part. If the disposition is null, any existing "Content-Disposition" header field is removed.
[中]
代码示例来源:origin: igniterealtime/Openfire
message.setDisposition(Part.INLINE);
sendMessage(message);
mPart.addBodyPart(bPart);
message.setContent(mPart);
message.setDisposition(Part.INLINE);
mPart.addBodyPart(bPart);
message.setContent(mPart);
message.setDisposition(Part.INLINE);
代码示例来源:origin: org.apache.james/james-server-core-library
/**
* @see javax.mail.Part#setDisposition(java.lang.String)
*/
public void setDisposition(String disposition) throws MessagingException {
getWrappedMessageForWriting().setDisposition(disposition);
}
代码示例来源:origin: org.igniterealtime.openfire/xmppserver
message.setDisposition(Part.INLINE);
sendMessage(message);
mPart.addBodyPart(bPart);
message.setContent(mPart);
message.setDisposition(Part.INLINE);
mPart.addBodyPart(bPart);
message.setContent(mPart);
message.setDisposition(Part.INLINE);
代码示例来源:origin: axis/axis
msg.setFrom(new InternetAddress(sendFrom));
msg.addRecipient(MimeMessage.RecipientType.TO, new InternetAddress(replyTo));
msg.setDisposition(MimePart.INLINE);
msg.setSubject(subject);
代码示例来源:origin: org.apache.axis/axis
msg.setFrom(new InternetAddress(sendFrom));
msg.addRecipient(MimeMessage.RecipientType.TO, new InternetAddress(replyTo));
msg.setDisposition(MimePart.INLINE);
msg.setSubject(subject);
代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis
msg.setFrom(new InternetAddress(sendFrom));
msg.addRecipient(MimeMessage.RecipientType.TO, new InternetAddress(replyTo));
msg.setDisposition(MimePart.INLINE);
msg.setSubject(subject);
代码示例来源:origin: axis/axis
msg.setDisposition(MimePart.INLINE);
msg.setSubject(id);
代码示例来源:origin: org.apache.axis/axis
msg.setDisposition(MimePart.INLINE);
msg.setSubject(id);
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.3.1_spec
public void setFileName(String name) throws MessagingException {
// there's an optional session property that requests file name encoding...we need to process this before
// setting the value.
if (name != null && SessionUtil.getBooleanProperty(session, MIME_ENCODEFILENAME, false)) {
try {
name = MimeUtility.encodeText(name);
} catch (UnsupportedEncodingException e) {
throw new MessagingException("Unable to encode filename", e);
}
}
// get the disposition string.
String disposition = getDisposition();
// if not there, then this is an attachment.
if (disposition == null) {
disposition = Part.ATTACHMENT;
}
// now create a disposition object and set the parameter.
ContentDisposition contentDisposition = new ContentDisposition(disposition);
contentDisposition.setParameter("filename", name);
// serialize this back out and reset.
setDisposition(contentDisposition.toString());
}
代码示例来源:origin: org.apache.axis/com.springsource.org.apache.axis
msg.setDisposition(MimePart.INLINE);
msg.setSubject(id);
代码示例来源:origin: org.apache.geronimo.specs/geronimo-javamail_1.4_spec
public void setFileName(String name) throws MessagingException {
// there's an optional session property that requests file name encoding...we need to process this before
// setting the value.
if (name != null && SessionUtil.getBooleanProperty(session, MIME_ENCODEFILENAME, false)) {
try {
name = MimeUtility.encodeText(name);
} catch (UnsupportedEncodingException e) {
throw new MessagingException("Unable to encode filename", e);
}
}
// get the disposition string.
String disposition = getDisposition();
// if not there, then this is an attachment.
if (disposition == null) {
disposition = Part.ATTACHMENT;
}
// now create a disposition object and set the parameter.
ContentDisposition contentDisposition = new ContentDisposition(disposition);
contentDisposition.setParameter("filename", name);
// serialize this back out and reset.
setDisposition(contentDisposition.toString());
}
代码示例来源:origin: miltonio/milton2
@Override
public void toMimeMessage(StandardMessage sm, MimeMessage mm) {
//System.out.println("StandardMessageFactoryImpl - toMimeMessage");
try {
//mm.setS
mm.setFrom(sm.getFrom().toInternetAddress());
mm.setSender(sm.getFrom().toInternetAddress());
fillReplyTo(sm, mm);
fillTo(sm.getTo(), mm);
fillCC(sm.getCc(), mm);
fillBCC(sm.getBcc(), mm);
//mm.setSubject(sm.getSubject(), "utf-8");
mm.setSubject(sm.getSubject());
mm.setDisposition(sm.getDisposition());
fillContentLanguage(sm.getContentLanguage(), mm);
fillContent(sm, mm);
// todo: set headers?
} catch (MessagingException ex) {
throw new RuntimeException(ex);
}
}
代码示例来源:origin: org.apache.james/apache-mailet-crypto
newMessage.setText(text(strippedMessage), StandardCharsets.UTF_8.name());
if (!strippedMessage.isMimeType("multipart/*")) {
newMessage.setDisposition(null);
代码示例来源:origin: EngineHub/CommandHelper
message.setDisposition(disposition);
内容来源于网络,如有侵权,请联系作者删除!