类 EmailUtil
java.lang.Object
cn.warpin.core.config.EmailUtil
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private StringgetFileExtension(String fileName) org.springframework.mail.javamail.JavaMailSenderImplgetMailSender(String userName, String password) voidsendMessage(String to, String subject, String content) 使用默认邮箱发送void发送纯文本邮件信息voidsendMessageCarryFile(String to, String subject, String content, File file) 发送带附件的邮件信息voidsendMessageCarryFiles(String to, String subject, String content, File[] files) 发送带附件的邮件信息voidsendMessageCarryUrlAttachment(String to, String subject, String content, String fileUrl) 发送带附件的邮件信息 URL url = new URI(encodeUrl(fileUrl)).toURL();
-
字段详细资料
-
fromMail
-
host
-
port
-
mailSender
private org.springframework.mail.javamail.JavaMailSender mailSender
-
-
构造器详细资料
-
EmailUtil
public EmailUtil()
-
-
方法详细资料
-
sendMessage
发送纯文本邮件信息- 参数:
from- 发送方to- 接收方subject- 邮件主题content- 邮件内容(发送内容)
-
sendMessage
使用默认邮箱发送- 参数:
to-subject-content-
-
sendMessageCarryFiles
发送带附件的邮件信息- 参数:
to- 接收方subject- 邮件主题content- 邮件内容(发送内容)files- 文件数组 // 可发送多个附件
-
sendMessageCarryFile
发送带附件的邮件信息- 参数:
to- 接收方subject- 邮件主题content- 邮件内容(发送内容)file- 单个文件
-
sendMessageCarryUrlAttachment
public void sendMessageCarryUrlAttachment(String to, String subject, String content, String fileUrl) 发送带附件的邮件信息 URL url = new URI(encodeUrl(fileUrl)).toURL();- 参数:
to-subject-content-fileUrl-
-
getMailSender
-
encodeUrl
-
getFileExtension
-