//Create
attachment body part
MimeBodyPart attachBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource("1.jpg");
attachBodyPart.setDataHandler(new DataHandler(source));
attachBodyPart.setFileName("1.jpg");
//Now
create the multipart and add the parts
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(mainBodyPart);
multipart.addBodyPart(attachBodyPart);
//add the
multipart to the original Mime message
msg.setContent(multipart);
Transport.send(msg);