我想将一些文件附加到我的电子邮件中,但出现此语法错误
if (attachedFiles != null && attachedFiles.size() > 0) {
for (File aFile : attachedFiles) {
MimeBodyPart attachPart = new MimeBodyPart();
try {
attachPart.attachFile(aFile);
} catch (IOException ex) {
ex.printStackTrace();
}
multipart.addBodyPart(attachPart);
}
}
最佳答案
我解决了添加 mail1_4.jar 的问题 旧版本不支持attach方法
关于java - 为什么我收到 AttachFile(File) is undefined for the type MimeBodyPart?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56206678/