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