How to embed a link in email message for file attached in email using JavaMail API? <p>I want to embed a link in email for file already attached in email message using JavaMail API.</p> <p>For example, I am sending an email with some attachments. Now I want to embed link for all files which are available in email message.</p> <p>Could you please help me on this?</p> <p>I am using below code to attach a file in email message:</p> <pre><code>MimeBodyPart messageBodyPart = new MimeBodyPart(); DataSource source = new FileDataSource(attachFile); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(attachFileName); </code></pre>