November 2006
Intermediate to advanced
224 pages
3h 29m
English
String html = "<html><head><title>Java Mail</title></head>" + "<body>Some HTML content.</body></html>"; Multipart mp = new MimeMultipart(); BodyPart textPart = new MimeBodyPart( ); textPart.setText("This is the message body."); BodyPart htmlPart = new MimeBodyPart( ); htmlPart.setContent(html, "text/html"); mp.addBodyPart(textPart); mp.addBodyPart(htmlPart); msg.setContent(mp); Transport.send(msg); |
MIME stands for Multimedia Internet Mail Extensions. MIME is supported by all major email clients and is the standard way of including attachments to messages. MIME allows you to attach a variety of media types, such as images, video, and .pdf files to an email message. The JavaMail API also supports MIME messages, and it is nearly ...
Read now
Unlock full access