in src/main/java/org/apache/commons/mail/MultiPartEmail.java [270:290]
public MultiPartEmail attach(final File file)
throws EmailException
{
final String fileName = file.getAbsolutePath();
try
{
if (!file.exists())
{
throw new IOException("\"" + fileName + "\" does not exist");
}
final FileDataSource fds = new FileDataSource(file);
return attach(fds, file.getName(), null, EmailAttachment.ATTACHMENT);
}
catch (final IOException e)
{
throw new EmailException("Cannot attach file \"" + fileName + "\"", e);
}
}