在jeecg-boot-module-system包下的modules.api.controller创建一个JeecgDemo1Controller类实现功能
package org.jeecg.modules.api.controller;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.modules.message.handle.impl.EmailSendMsgHandle;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test/jeecgDemo")
@Slf4j
public class JeecgDemo1Controller {
/**
* hello world
*
* @param
* @return
*/
@GetMapping(value = "/hello")
public void hello() {
String es_receiver = "xxxxxxxxxx@qq.com"; //要发送人的qq邮箱
String es_title = "我是健康喝水小助手"; //标题
String es_content = "累了吧,快起来喝水"; //内容
final EmailSendMsgHandle emailSendMsgHandle = new EmailSendMsgHandle();
emailSendMsgHandle.SendMsg(es_receiver ,es_title ,es_content );
}
}