Java郵件發送開發庫,Apache Commons Email 1.3.3 發布
Apache Commons Email 1.3.3 發布了, Commons Email 的目的是提供一個API來發送電子郵件。它是建立在Java Mail API 之上,旨在簡化使用。
它提供的一些主要類如下:
- SimpleEmail - 這個類是用來發送基本的基于文本的電子郵件。
- MultiPartEmail - This class is used to send multipart messages. This allows a text message with attachments either inline or attached.
- HtmlEmail - This class is used to send HTML formatted emails. It has all of the capabilities as MultiPartEmail allowing attachments to be easily added. It also supports embedded images.
- ImageHtmlEmail - This class is used to send HTML formatted emails with inline images. It has all of the capabilities as HtmlEmail but transform all image references to inline images.
- EmailAttachment - This is a simple container class to allow for easy handling of attachments. It is for use with instances of MultiPartEmail and HtmlEmail. </ul>
Email email = new SimpleEmail(); email.setHostName("smtp.googlemail.com"); email.setSmtpPort(465); email.setAuthenticator(new DefaultAuthenticator("username", "password")); email.setSSLOnConnect(true); email.setFrom("user@gmail.com"); email.setSubject("TestMail"); email.setMsg("This is a test mail ... :-)"); email.addTo("foo@bar.com"); email.send();
該版本在 1.3.2 的基礎上改進如下:
== 兼容性==
- Java 5 或更高版本(從1.3不變)。
== Bugs 修復==
附件的文件名包含了非ASCII字符,編碼會不正確的情況。 Issue: EMAIL-138. Thanks to qed.
MimeMessageParser沒有正確解析由 HtmlEmail.buildMimeMessage()和HtmlEmail.getMimeMessage()所創造的MimeMessage對象 Issue: EMAIL-137. Thanks to Alex Kogan.
Fix Javadoc 1.8 errors. Issue: EMAIL-136. Thanks to Ville Skytt?.</pre> 下載:http://commons.apache.org/proper/commons-email/
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!