|
|
|
|
@ -23,18 +23,8 @@ public class EmailConfig {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取 SMTP 服务器的端口号。
|
|
|
|
|
*
|
|
|
|
|
* @return SMTP 端口号。
|
|
|
|
|
*/
|
|
|
|
|
public static int getPort() {
|
|
|
|
|
return Integer.parseInt(properties.getProperty("smtp.port"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 获取 SMTP 服务器的主机名。
|
|
|
|
|
*
|
|
|
|
|
* @return SMTP 主机名字符串。
|
|
|
|
|
@ -43,15 +33,13 @@ public class EmailConfig {
|
|
|
|
|
return properties.getProperty("smtp.host");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取用于 SMTP 认证的密码或授权码。
|
|
|
|
|
* 获取 SMTP 服务器的端口号。
|
|
|
|
|
*
|
|
|
|
|
* @return SMTP 密码或授权码。
|
|
|
|
|
* @return SMTP 端口号。
|
|
|
|
|
*/
|
|
|
|
|
public static String getPassword() {
|
|
|
|
|
return properties.getProperty("smtp.password");
|
|
|
|
|
public static int getPort() {
|
|
|
|
|
return Integer.parseInt(properties.getProperty("smtp.port"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -62,4 +50,13 @@ public class EmailConfig {
|
|
|
|
|
public static String getUsername() {
|
|
|
|
|
return properties.getProperty("smtp.username");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取用于 SMTP 认证的密码或授权码。
|
|
|
|
|
*
|
|
|
|
|
* @return SMTP 密码或授权码。
|
|
|
|
|
*/
|
|
|
|
|
public static String getPassword() {
|
|
|
|
|
return properties.getProperty("smtp.password");
|
|
|
|
|
}
|
|
|
|
|
}
|