public Disposition file(final String fileName) {
Disposition disposition = new Disposition() {
public Mail inline() {
FileAttachment attachment = new FileAttachment(ContentDisposition.INLINE, new File(fileName));
emailMessage.addAttachment(attachment);
return MailImpl.this;
}
public Mail attachment() {
FileAttachment attachment = new FileAttachment(ContentDisposition.ATTACHMENT,
new File(fileName));
emailMessage.addAttachment(attachment);
return MailImpl.this;
}
};
return disposition;
}
public Disposition file(final File file) {
Disposition disposition = new Disposition() {
public Mail inline() {
FileAttachment attachment = new FileAttachment(ContentDisposition.INLINE, file);
emailMessage.addAttachment(attachment);
return MailImpl.this;
}
public Mail attachment() {
FileAttachment attachment = new FileAttachment(ContentDisposition.ATTACHMENT, file);
emailMessage.addAttachment(attachment);
return MailImpl.this;
}
};