Skip to content

heanbian/heanbian-email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

heanbian-email

前提条件

JDK 21

pom.xml

具体版本,可以从 Maven Central获得

<dependency>
  <groupId>com.heanbian</groupId>
  <artifactId>heanbian-email</artifactId>
  <version>20.3</version>
</dependency>

使用示例

  • EmailConfig

  • EmailMessage

  • EmailTemplate

EmailConfig config = new EmailConfig(host, port, username, password, from, debug);
EmailMessage message = new EmailMessage(subject, toAddress, content);
EmailTemplate template = new EmailTemplate(config, message);
template.send();

说明:支持HTML邮件内容、附件File、接收人TO、抄送人CC、密送人BCC等。