update 适配 com.sun.mail 更改为 jakarta.mail 修改最新写法

feature/model
疯狂的狮子Li 2 years ago
parent a3e23b259c
commit c7dcbd5c3b

@ -113,8 +113,8 @@
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
</dependency>
<dependency>

@ -11,8 +11,8 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import javax.mail.Authenticator;
import javax.mail.Session;
import jakarta.mail.Authenticator;
import jakarta.mail.Session;
import java.io.File;
import java.io.InputStream;
import java.util.Collection;

@ -0,0 +1,33 @@
package com.ruoyi.common.utils.email;
import jakarta.mail.Authenticator;
import jakarta.mail.PasswordAuthentication;
/**
*
*
* @author looly
* @since 3.1.2
*/
public class UserPassAuthenticator extends Authenticator {
private final String user;
private final String pass;
/**
*
*
* @param user
* @param pass
*/
public UserPassAuthenticator(String user, String pass) {
this.user = user;
this.pass = pass;
}
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(this.user, this.pass);
}
}
Loading…
Cancel
Save