调解系统修改

This commit is contained in:
18792927508
2024-04-02 15:56:40 +08:00
parent 08f4aca27c
commit 72026ee6f4
51 changed files with 3102 additions and 3242 deletions
@@ -1,10 +1,12 @@
package com.ruoyi.common.utils;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.utils.uuid.UUID;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.MailException;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
@@ -72,17 +74,29 @@ public class EmailOutUtil {
* @param subject 邮件主题
* @param content 邮件内容(发送内容)
*/
public void sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
// 创建一个邮件对象
SimpleMailMessage msg = new SimpleMailMessage();
msg.setFrom(from);
msg.setTo(to);
// 设置邮件主题
msg.setSubject(subject);
// 设置邮件内容
msg.setText(content);
// 发送邮件
mailSender.send(msg);
public Boolean sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
try {
if(mailSender==null){
rebuildMailSender();
}
// 创建一个邮件对象
SimpleMailMessage msg = new SimpleMailMessage();
if(StrUtil.isEmpty(from)){
msg.setFrom(usernameOut);
}else {
msg.setFrom(from);
}
msg.setTo(to);
// 设置邮件主题
msg.setSubject(subject);
// 设置邮件内容
msg.setText(content);
// 发送邮件
mailSender.send(msg);
} catch (MailException e) {
return false;
}
return true;
////System.out.println("发送成功:" + from + ":to:" + to);
}