-
邮件发送工具类 SendMail.java
- package com.util;
-
- import org.apache.commons.mail.EmailException;
- import org.apache.commons.mail.SimpleEmail;
-
- public class SendMail {
- private String hostName;
- private String sendMailAddress;
- private String mailPassword;
- private boolean TLS = false;
- private String[] getMailAddress;
- private String mailTitle;
- private String mailContent;
-
- public void send(){
- SimpleEmail email = new SimpleEmail();
- email.setTLS(TLS);
- email.setHostName(hostName);
- try {
- email.setFrom(sendMailAddress, sendMailAddress);
- email.setAuthentication(sendMailAddress, mailPassword);
- email.setCharset("utf-8");
- email.setSubject(mailTitle);
- email.setMsg(mailContent);
- for(int i = 0; i < getMailAddress.length; ++i){
- email.addTo(getMailAddress[i]);
- email.send();
- }
-
-
- } catch (EmailException e) {
-
- }
- }
-
- public String getHostName() {
- return hostName;
- }
-
- public void setHostName(String hostName) {
- this.hostName = hostName;
- }
-
- public String getSendMailAddress() {
- return sendMailAddress;
- }
-
- public void setSendMailAddress(String sendMailAddress) {
- this.sendMailAddress = sendMailAddress;
- }
-
- public String getMailPassword() {
- return mailPassword;
- }
-
- public void setMailPassword(String mailPassword) {
- this.mailPassword = mailPassword;
- }
-
- public boolean isTLS() {
- return TLS;
- }
-
- public void setTLS(boolean tls) {
- TLS = tls;
- }
-
- public String[] getGetMailAddress() {
- return getMailAddress;
- }
-
- public void setGetMailAddress(String[] getMailAddress) {
- this.getMailAddress = getMailAddress;
- }
-
- public String getMailTitle() {
- return mailTitle;
- }
-
- public void setMailTitle(String mailTitle) {
- this.mailTitle = mailTitle;
- }
-
- public String getMailContent() {
- return mailContent;
- }
-
- public void setMailContent(String mailContent) {
- this.mailContent = mailContent;
- }
- }
-
相关阅读:
语音识别算法阅读之CTC
语音识别模型阅读之CLDNN
声纹识别算法阅读之self-attentive x-vector
Git链接两个远程仓库
tortoisegit提交不到远程库问题解决记录
安装 Git 命令之后,本地的工作区中的文件没有小图标解决办法
.NET CLS(Common Language System)简介
.NET CTS(Common Type System)简介
C# 中间语言
.NET 程序执行流程
-
原文地址:https://www.cnblogs.com/swite/p/5168737.html
Copyright © 2020-2023
润新知