本文整理了Java中javax.mail.Message.setDataHandler()
方法的一些代码示例,展示了Message.setDataHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.setDataHandler()
方法的具体详情如下:
包路径:javax.mail.Message
类名称:Message
方法名:setDataHandler
暂无
代码示例来源:origin: kiegroup/jbpm
msg.setDataHandler( new DataHandler( new ByteArrayDataSource( body, "text/html" ) ) );
代码示例来源:origin: google/mail-importer
@Override
public void setDataHandler(DataHandler dh) throws RuntimeMessagingException {
try {
delegate.setDataHandler(dh);
} catch (MessagingException e) {
throw new RuntimeMessagingException(e);
}
}
代码示例来源:origin: stackoverflow.com
Message message = new MimeMessage(session);
message.setDataHandler(new DataHandler(new ByteArrayDataSource(csv.getBytes("8859_8"),
"text/csv")));
message.setFileName("data.csv");
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("Query report...");
Transport.send(message);
LOG.info("Sent message successfully ...");
代码示例来源:origin: spring-projects/spring-ws
@Override
protected void onSendAfterWrite(WebServiceMessage message) throws IOException {
Transport transport = null;
try {
responseMessage.setDataHandler(
new DataHandler(new ByteArrayDataSource(responseContentType, responseBuffer.toByteArray())));
transport = session.getTransport(transportUri);
transport.connect();
responseMessage.saveChanges();
transport.sendMessage(responseMessage, responseMessage.getAllRecipients());
}
catch (MessagingException ex) {
throw new MailTransportException(ex);
}
finally {
MailTransportUtils.closeService(transport);
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
protected void onSendAfterWrite(WebServiceMessage message) throws IOException {
Transport transport = null;
try {
responseMessage.setDataHandler(
new DataHandler(new ByteArrayDataSource(responseContentType, responseBuffer.toByteArray())));
transport = session.getTransport(transportUri);
transport.connect();
responseMessage.saveChanges();
transport.sendMessage(responseMessage, responseMessage.getAllRecipients());
}
catch (MessagingException ex) {
throw new MailTransportException(ex);
}
finally {
MailTransportUtils.closeService(transport);
}
}
代码示例来源:origin: org.springframework.ws/spring-ws-support
@Override
protected void onSendAfterWrite(WebServiceMessage message) throws IOException {
Transport transport = null;
try {
responseMessage.setDataHandler(
new DataHandler(new ByteArrayDataSource(responseContentType, responseBuffer.toByteArray())));
transport = session.getTransport(transportUri);
transport.connect();
responseMessage.saveChanges();
transport.sendMessage(responseMessage, responseMessage.getAllRecipients());
}
catch (MessagingException ex) {
throw new MailTransportException(ex);
}
finally {
MailTransportUtils.closeService(transport);
}
}
代码示例来源:origin: lutece-platform/lutece-core
msg.setDataHandler( new DataHandler( new ByteArrayDataSource( strMessage, AppPropertiesService.getProperty( PROPERTY_MAIL_TYPE_PLAIN )
+ AppPropertiesService.getProperty( PROPERTY_CHARSET ) ) ) );
代码示例来源:origin: org.jbpm/jbpm-workitems-email
msg.setDataHandler(new DataHandler(new ByteArrayDataSource(message.getBody(),
"text/html")));
代码示例来源:origin: lutece-platform/lutece-core
msg.setDataHandler( new DataHandler( new ByteArrayDataSource( strMessage, AppPropertiesService.getProperty( PROPERTY_MAIL_TYPE_HTML )
+ AppPropertiesService.getProperty( PROPERTY_CHARSET ) ) ) );
内容来源于网络,如有侵权,请联系作者删除!