My problem was resolved this morning: Java Mail, sending multiple attachments does not work
This time I have a slightly more complicated problem: I would like to combine the attached files with the images.
import java.io.IOException; import java.util.Properties; import javax.activation.DataHandler; import javax.activation.FileDataSource; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; public class MailTest { public static void main(String[] args) throws AddressException, MessagingException, IOException { String host = "***"; String from = "***"; String to = "***";
When I open an email in Gmail, everything is fine: I have two attachments, and the image is displayed in the mail content (in the img tag).
The problem is with Thunderbird and with RoundCubic webmail: each one shown as an image is missing and displays it at the bottom as an attachment.
How can I do this job?
source share