diff options
author | Vitaly Takmazov | 2022-10-24 01:09:32 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-11-25 14:16:03 +0300 |
commit | 9faf43a6c4b933b5f97be4348d461bf91f5bf2e2 (patch) | |
tree | 238968b200c73d905b9367154fddb7ac3eff6274 /src/main/java/com/juick/EmailManager.java | |
parent | e0a98e8bd925bc5aebe49d011bb4ec17978f8bd9 (diff) |
Spring Boot 3
Diffstat (limited to 'src/main/java/com/juick/EmailManager.java')
-rw-r--r-- | src/main/java/com/juick/EmailManager.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/com/juick/EmailManager.java b/src/main/java/com/juick/EmailManager.java index 8ef1a270..a62d31f3 100644 --- a/src/main/java/com/juick/EmailManager.java +++ b/src/main/java/com/juick/EmailManager.java @@ -22,6 +22,16 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.juick.model.Message; import com.juick.model.User; import com.juick.www.api.SystemActivity; + +import jakarta.mail.MessagingException; +import jakarta.mail.Multipart; +import jakarta.mail.Session; +import jakarta.mail.Transport; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeBodyPart; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeMultipart; + import com.juick.util.HttpBadRequestException; import com.juick.www.WebApp; import com.juick.service.EmailService; @@ -38,14 +48,6 @@ import org.springframework.scheduling.annotation.Async; import javax.annotation.Nonnull; import javax.inject.Inject; -import javax.mail.MessagingException; -import javax.mail.Multipart; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeBodyPart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; import java.util.*; import static com.juick.util.formatters.PlainTextFormatter.formatPost; @@ -163,7 +165,7 @@ public class EmailManager implements NotificationListener { }; String fromAddress = StringUtils.isNotEmpty(from) ? from : "juick@juick.com"; message.setFrom(fromAddress); - message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(to)); + message.addRecipient(jakarta.mail.Message.RecipientType.TO, new InternetAddress(to)); message.setSubject(subject); MimeBodyPart textBodyPart = new MimeBodyPart(); textBodyPart.setContent(textPart, "text/plain; charset=UTF-8"); |