摘要
Spring框架在JavaMail的基础上对发送邮件进行了很好的支持,Spring mail包中定义了MailMessage和MailSender两个接口来描述了邮件消息和发送者。分析了MailMessage接口的具体实现类SimpleMailMessage和MimeMailMessage的应用特点,详细介绍了用MimeMessageHelper类进行邮件附件的消息设置过程。结合实例讨论了用JavaMailSenderImpl类实现与邮件服务器的连接设置及邮件发送方法,最后,给出了发送各类邮件的实现方法。
Based on JavaMail,Spring framework provides good support for email sending. In Spring mail pack-age, the MailMessage and MailSender interfaces are defined to describe a mail message and sender. This paper has analyzed the application characteristics of SimpleMailMessage and MimeMailMessage ,the MailMessage inter-face implementation classes,and discussed detailedly the use of MimeMessageHelper class in mail attachment message setting process. It has also explored the usage of JavaMailSenderImpl in the realization of connection settings with email server and email transmitting method. Finally ,it gives the realization methods for sending all types of emails.
出处
《苏州科技学院学报(自然科学版)》
CAS
2014年第1期62-66,共5页
Journal of Suzhou University of Science and Technology (Natural Science Edition)