Skip to content

fine-main模块

  • 邮箱模块

依赖

  • pom.xml
xml
<!--fine-mail-->
<dependency>
    <groupId>cn.finemap</groupId>
    <artifactId>fine-mail</artifactId>
    <version>${fine.version}</version>
</dependency>

创建子模块:fine-mail

  • 在fine-parent中创建:fine-mail子模块

fine-mail

  • 创建子模块:New > Module...
  • 添加短信依赖
依赖
  • fine-mail/pom.xml
xml
<!-- 依赖 -->
<dependencies>
    <!-- 邮箱 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <!-- 框架工具类 -->
        <dependency>
            <groupId>cn.finemap</groupId>
            <artifactId>fine-commons</artifactId>
            <version>${fine.version}</version>
            <optional>true</optional>
        </dependency>
</dependencies>

fine-mail使用

发生内容

服务端调用

java
// 获取邮件配置
Properties props = MailUtils.getProperties("smtp.exmail.qq.com", "465", "true");
// 发生内容
MailUtils.sendEmail(props, username, password, "821568777@qq.com", "测试邮件", "测试邮件内容");
// 发生界面
MailUtils.sendEmailHtml(props, username, password, "821568777@qq.com", "测试邮件", "<!DOCTYPE html>");