here is my code which attach and send image but i want to load image form local drive and embed it to body of mail without attaching please help me i have searched still no solution.thanks import org.apache.commons.mail.DefaultAuthenticator; import org.apache.commons.mail.EmailAttachment; import org.apache.commons.mail.HtmlEmail;\[code\]public class img { public static void main(String[]args) throws Exception { // Create the attachment EmailAttachment attachment = new EmailAttachment(); attachment.setPath("Monthly Target AchivedDaily.gif"); attachment.setDisposition(EmailAttachment.INLINE); attachment.setDescription("Monthly"); attachment.setName("1"); HtmlEmail he = new HtmlEmail(); he.setSmtpPort(25); he.setAuthenticator(new DefaultAuthenticator("myid","mypwd")); he.setDebug(false); he.setHostName("..com"); he.addTo("@.com","hsn"); //email.setSSL(true); he.setFrom("mail", "Hassan"); he.setSubject("tst1"); he.attach(attachment); he.send(); System.out.println("Done..."); }}\[/code\]i have found this code to embed image in email i have few questionsWhere i can put smtp portwhere i can put my id / paswordor let the code workingcode:\[code\] Properties sessionProperties = System.getProperties(); sessionProperties.put("newmail.etilizepak.com", "newmail.etilizepak.com"); Session session = Session.getDefaultInstance(sessionProperties, null); // Create message Message message = new MimeMessage(session); message.setFrom(new InternetAddress("[email protected]")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("[email protected]", false)); message.setSubject("hi"); // Add html content // Specify the cid of the image to include in the email String html = "<html><body><b>Test</b> email <img src='http://stackoverflow.com/questions/15691831/cid:my-image-id'></body></html>"; Multipart mp = new MimeMultipart(); MimeBodyPart htmlPart = new MimeBodyPart(); htmlPart.setContent(html, "text/html"); mp.addBodyPart(htmlPart); // add image in another part MimeBodyPart imagePart = new MimeBodyPart(); DataSource fds = new FileDataSource("c:/img"); imagePart.setDataHandler(new DataHandler(fds)); // assign a cid to the image imagePart.setHeader("Content-ID", "my-image-id"); mp.addBodyPart(imagePart); message.setContent(mp); // Send the message Transport.send(message);\[/code\]