public abstract class AbstractMimeMessage extends Object implements MimeMessage
MimeMessage interface. Contains convenient default implementations.| Constructor and Description |
|---|
AbstractMimeMessage() |
| Modifier and Type | Method and Description |
|---|---|
Attachment |
addAttachment(String contentId,
File file)
Add an attachment to the message, taking the content from a
File. |
Attachment |
addAttachment(String contentId,
InputStreamSource inputStreamSource,
String contentType)
Add an attachment to the message, taking the content from an
InputStreamSource. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAttachment, convertToXopPackage, getAttachment, getAttachments, isXopPackagegetPayloadResult, getPayloadSource, writeTopublic final Attachment addAttachment(String contentId, File file) throws AttachmentException
MimeMessageFile.
The content type will be determined by the name of the given content file. Do not use this for temporary files with arbitrary filenames (possibly ending in ".tmp" or the like)!
addAttachment in interface MimeMessagecontentId - the content Id of the attachmentfile - the file to take the content fromAttachmentException - in case of errorspublic final Attachment addAttachment(String contentId, InputStreamSource inputStreamSource, String contentType)
MimeMessageInputStreamSource.
Note that the stream returned by the source needs to be a fresh one on each call, as underlying
implementations can invoke InputStreamSource.getInputStream() multiple times.
addAttachment in interface MimeMessagecontentId - the content Id of the attachmentinputStreamSource - the resource to take the content from (all of Spring's Resource implementations can be
passed in here)contentType - the content type to use for the elementResource