Commons Email(Java)
Commons Email
Commons-Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify.
Some of the mail classes that are provided are as follows:
- SimpleEmail - This class is used to send basic text based emails.
- 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.
- EmailAttachment - This is a simple container class to allow for easy handling of attachments. It is for use with instances of MultiPartEmail and HtmlEmail.
Homepage: http://commons.apache.org/email/
用commons-email-1.1.jar实现发邮件功能
今天在Apache网站上下载commons-lang jar文件时突然看到commons-email-1.1.jar这个项目jar文件,看了看user guide确实比JDK提供的好多了,简单的几行代码就实现了发邮件的功能,以前实现过一个纯JavaMail带附件发邮件功能,代码复杂不说,现在回过头来都懒得看(主要是WEB项目注释少)。 贴上TEST代码看看,简单、清晰。只要稍加修改(邮件...
用Java Mail发送带图片附件的要点
1,读入图片的方式: 发现网上讲的很多读取图片的方式都不对,按下面提供的这个方法来读取,保证成功。 1 private byte[] getImageBytes(String file) { 2 byte[] myData = null; 3 &nbs...
用JavaMail发送和接收邮件
用JavaMail发送邮件 package com.mailsystem.example; import java.util.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; public class SendAttachment ...{ public static void main(String[] args) &nbs...
用Commons-Email来发邮件
Commons-Email项目旨在提供邮件发送的API,它是在JavaMail API的基础上构建的。 Some of the mail classes that are provided are as follows: SimpleEmail - This class is used to send basic text based emails. MultiPartEmail - This class is used to send multipart messages. This allows a text message with attachments either inli...
简化JavaMail:小巧 Jakarta Commons-Email 简单教程
Jakarta发布了Commons Emails 1.0 released 版本,目的是为了简化JavaMail。 知道有它几个class吗?你一定想不到,只有8个! 好了,开始我们的jakarta commons emails 之旅:) 一:Quick Start 通过SimpleEmail发送邮件 1java.lang.Object 2 org.apache.commons.mail.Email 3 org.apache.commons...