I am trying to send an email with an attachment file in Java.
When I send the email without an attachment I receive the email, but when I add the attachment I don\'t
You can try something like:
File f = new File(file); MimeBodyPart attachmentPart = new MimeBodyPart(); attachmentPart.attachFile(f); multipart.addBodyPart(attachmentPart);
See more details on: Send email via SMTP with attachment, plain/text, and text/hml