Questions tagged [jakarta-mail]
A Java API to send and receive emails. Jakarta Mail (previously JavaMail) is part of Jakarta EE (previously Java EE), but can also be used in Java SE via a separate download.
5,203
questions
0
votes
0
answers
20
views
PLAIN + IMAP + SSL Android Java - failed connection
I am trying to connect to a mail server using the imap protocol over ssl and authorization using the plain method.
Properties props = new Properties();
props.put("mail.store.protocol"...
0
votes
0
answers
35
views
Getting Exception while using Java Mail for Office 365
I am getting below exception while sending mails using Java Mail for Office365 Exchange server through our application in Windows Server. The Windows server is located in cloud platform. The same ...
0
votes
1
answer
103
views
jakarta.mail.Provider: com.sun.mail.imap.IMAPProvider not a subtype
I am new to Springboot and Java. I am trying to send an email from my Gmail account via Spring Boot. So far I was able to run the code after all configurations. But throws
jakarta.mail.Provider: com....
0
votes
0
answers
20
views
Jakarta Mail works as standalone but not in Web Applicaton - where it throws Authentication exception
I have managed to write a Java Program successfully to generate an email from my GMail account to the outlook account. Here is the excerpt of the code:
String to="<my>@outlook.com";
...
0
votes
0
answers
30
views
Wrong mail attachment name after transition to Java 17
I used Java 8 in the project. For mail sending I use javax.mail library. Everything worked. I sent a mail with .xlsx attachment:
Now I change to Java 17 and some problem became: now the attachment ...
0
votes
0
answers
24
views
Connect OutlookMail Fail A1 and A3 Errors JavaMail with simple login and pass to connect in Outlook365 Mail
i need connect in outlook365 just to read email , with login and pass to one integration, and i need to be login and pass without XOAUTH.
I already tried a lot of codes without success, if anyone can ...
0
votes
1
answer
39
views
I send an email with html from my method with java mail and only in gmail it arrives broken and without some styles, what is it?
this is my main method and the second one is where I call it. The way that my html format seems to be right, styles are inline and this works when I send it to an outlook user or when I put the html ...
0
votes
0
answers
41
views
Java Exception sending email using smtp.office365.com
Since yesterday, sending emails using JavaMailSender has failed using smp.office365.com as the smtp server. The certificate is correctly loaded into the keystore but the system logs this exception:
...
0
votes
0
answers
25
views
force Tomcat to use jakarta.mail instead of java mail with TLS
I'm trying to send mail using office365 in a java application with Jakarta Mail version 1.6.7, and it works fine on my windows machine.
Using the same application on Ubuntu 22 I catch this error:
...
0
votes
1
answer
20
views
Gmail API doesn't recognize my attchments as attachments but as multipart/mixed why?
My method of sending mail with attachments works, however, the API doesn't recognize my attachments as attachments but as multipart/mixed.
It's annoying because I need the id of my attachments for the ...
1
vote
0
answers
86
views
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) sending mail
Good morning,
I'm trying to send a mail in a java application running on Ubuntu with jakarta.mail-api version 2.1.2 and openjdk version 11.0.20.1
but I obtain following exception:
javax.net.ssl....
1
vote
1
answer
56
views
Switched to JakartaMail org.springframework.mail.javamail.JavaMailSender InputStreamResource from byte array
I'm moving from mailx to Jakarta.
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxmailtojakartamail
or with IntelliJ
import org.springframework.mail.SimpleMailMessage;
import org....
0
votes
2
answers
240
views
Migrating Java Rest Services from JDK 8 to 17
Converting an Java Web Service from JDK 8 to 17.
I started to convert the javax to jakarta. I got my project to compile. But I get this error when I run my unit test:
ava.lang.NoSuchMethodError: '...
0
votes
0
answers
17
views
spring-boot-starter-mail 3.0.5 - Not provider of jakarta.mail.util.StreamProvider was found [duplicate]
I am using spring-boot-starter-mail v3.0.5.
I am aware of an existing issue (found here: https://github.com/jakartaee/mail-api/issues/665) in this version which causes the following exception:
..Not ...
0
votes
0
answers
127
views
Java javax.mail, msal4j Oauth2 send email using Office 365
I would like to send a e-mail. I use Java 1.8, com.microsoft.aad.msal4j und javax.mail.
However, I get the following error. No matter what I specify:
5.7.3 Authentication unsuccessful [........PROD....
0
votes
0
answers
57
views
Getting empty email body while parsing eml to json only when eml contains attachment
I am writing transform to convert eml to JSON. I have written the below code to parse eml. I want to extract the mail body and attachments from the eml. But whenever eml contains attachments I get an ...
0
votes
1
answer
54
views
Duplicate class conflict when using jakarta.mail-api with angus implementation
My application uses the following dependencies:
<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<version>2.1.2<...
0
votes
0
answers
17
views
JavaMail for Android works for the debug version but not the release version [duplicate]
I am using javax.mail targeting Android:
implementation 'com.sun.mail:android-mail:1.6.7'
implementation 'com.sun.mail:android-activation:1.6.7'
Code:
try {
// Create a Properties object
...
1
vote
1
answer
352
views
Alternative for apache commons-email and Jakarta
We've upgraded our application to Spring6/Tomcat10 (that implies migration from Java EE to Jakarta) and could not find jakarta compatible alternative for apache commons-email library?!
We seem to have ...
-1
votes
1
answer
20
views
I have a Problem with javax.mail parsing eml file
javax.mail which version is 1.6.2 will have the problem of losing pictures when parsing eml files that contain text, pictures and attachments at the same time.
I wrote the following code to verify ...
0
votes
0
answers
11
views
How to check if the received mail is a notification for a failed sent mail
If I send a mail to someone, and put wrong email address. Then a notification mail comes back saying that email id does not exist.
If we want to do this process automatically by a java code using ...
0
votes
0
answers
9
views
Java Mail Search Term is not working while fetching mails from IBM domino
I am trying to fetch mails for a one particular date from IBM domino, but Java mails Search Term is not working.
I am able to fetch all the mails in the inbox, but I want to fetch only for one ...
1
vote
0
answers
192
views
jakarta mail with TLS and checkserver identity problem
I am trying to send an email with jakarta mail, with tls and checkserveridentity but it fails with an exception:
jakarta.mail.MessagingException: Could not convert socket to TLS; nested exception is: ...
0
votes
1
answer
50
views
How to fetch mails from IBM Domino Lotus using External java code (IMAP)?
I want to fetch mails from my inbox using external java code and read the message.
I am able to connect to Gmail and fetch and read the mails using external java code with the help of javamail api.
...
1
vote
1
answer
630
views
Jakarta Mail: Can't verify identity of server
I'm trying to send e-mails in a Spring Boot application and get this exception
org.springframework.mail.MailSendException: Mail server connection failed. Failed messages: jakarta.mail....
1
vote
0
answers
91
views
JavaMail Session Glassfish
Good evening everyone,
I am working on a jakarta ee project for a few days but I am stuck.
Indeed, I created a JavaMail Session that I use in my project to send Mail at the start and stop of my web ...
-1
votes
2
answers
758
views
Outlook Javax.mail 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully
I am trying to send an email using jakarta.mail 2.0.1.
The below mentioned error has started occurring recently. I am not sure what is causing it, but I suspect that it might have something to do with ...
0
votes
0
answers
138
views
JavaMailSender - NoClassDefFoundError on jakarta/mail/Transport while sending email
I'm trying to send an email with JavaMailSender but I get a NoClassDefFoundError on jakarta/mail/Transport.
The full stacktrace : https://pastebin.com/eCNHpxT5
The pom : https://pastebin.com/jC6nfuRu
...
0
votes
0
answers
36
views
Apache HtmlEmail setPort is ignored
When I try to send a Apache Commons HtmlEmail with a specific port set, it works locally on my machine, but in the deployed docker container, the connection is refused because the port setting is ...
0
votes
0
answers
50
views
How to add inline image in html email with Micronaut
I am using Micronaut for web application and I need to send emails. We use velocity template for the email body and we need to include an image in the text. I found out there are 3 ways:
Base64 ...
0
votes
1
answer
87
views
How to set camel mail component to use TLS 1.3
When trying to send mails using camel I get the following error:
Stacktrace: javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl....
0
votes
0
answers
42
views
How to construct spring.messaging.message object from MIME content
I trying to find out a helper/builder method which can construct the spring.messaging.message object from the text/plain content I receive from microsoft graph API which returns MIME version of an ...
0
votes
1
answer
230
views
javax.mail version compatibility
which is the javax.mail version is compatible with java version 1.7.0_191
and which version of java is compatible with javax.mail-1.5.6.jar
please let us know the correct answer because i am facing a ...
-2
votes
2
answers
61
views
Connecting to IMAPS MIcrosoft Exchange server fails with Cannot invoke "String.equals(Object)" because "this.status" is null
I've been trying and failling to connect to IMAPs server using Javamail. This is my example implementation:
public List<Mail> receive() throws MessagingException {
IMAPStore emailStore = ...
0
votes
0
answers
25
views
Strange error when connecting to Gmail IMAP
public List<Email> getMessages() {
Store store = null;
Folder inbox = null;
Properties props = new Properties();
props.setProperty("mail.store.protocol",...
0
votes
0
answers
21
views
getResourceAsStream fetch clientsecret
I have this userEndpoint I use (in wildfly 27 and jakarta ee) and when I try to run in Postman, it gives an error, but when I try in the main method, it works. I try to send an email using an API call....
0
votes
0
answers
137
views
Folding a very long email header for List-Unsubscribe
I have a requirement that needs me to write a List-Unsubscribe header to an outgoing email. I am using the MimeMessage from Jakarta.
The value for List-Unsubscribe header has a potential to be very ...
1
vote
1
answer
84
views
ImapIdleChannelAdapter doesn't reconnect to IDLE after timeout
I use ImapIdleChannelAdapter (6.1.0) for retrieving messages from exchange v4 email service and have noticed that after some period of time approximately 30m probably because IDLE connection lasts 30m ...
1
vote
2
answers
2k
views
Spring-boot-starter-mail 3.1.1 throws "Not provider of jakarta.mail.util.StreamProvider was found"
I am upgrading my project from springboot 2.7.7 to springboot 3.1.1 and java 11 to 17
I have spring-boot-starter-mail included as a dependency and I try to send mail as follows
@Service
public class ...
1
vote
0
answers
225
views
Can't send email using smtp protocol for IPV6 address
I use smtp.mail.ru as smtp server and this server corresponds to multiple IP addresses(based on my experiments different amount of servers from differernt networks) and one of those servers is ipv6. I ...
-1
votes
2
answers
75
views
Why not working JavaMail API - Checking Emails?
I developed the Checking Emails system with JavaMail.This is the code I created,
String host = "pop.gmail.com";
String mailStoreType = "pop3";
String username = "...
-4
votes
1
answer
39
views
Java sendmail works only on development computer?
A sendmailcode with java programmed on Apache Netbeans only works on the
development computer.
String host = "smtp.xxxxx.com";
String Password = "xxxxxxxxxxxxxxxxxxxx";
...
0
votes
1
answer
383
views
What is the role of the "mail.smtp.auth" parameter in the JavaMailSender?
I use JavaMailSender to send emails. I configured the corresponding username and password in the configuration file, but an error occurred when sending the email. The error message is org.apache....
1
vote
1
answer
222
views
How can I classify an email as internal in Outlook when sending it using JavaMail with Java Spring and Spring Boot?
How to add confidentiality using mime message .
Message msg = new Message ( session)
msg. Setfrom(….)
msg.setReply(…)
msg. Setsubject(…)
….
I tried below and able to get in mail that “please treat ...
1
vote
2
answers
118
views
"BASE64DecoderStream" gives error for javax-mail dependency
I recently changed the dependency
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency&...
0
votes
0
answers
26
views
Spring Integration ImapFolder unpredictable short lifetime
I have Imap idle based IntegrationFlow configured from following spec:
Mail.imapIdleAdapter(url)
.javaMailProperties(javaMailProperties)
.javaMailAuthenticator(new ...
0
votes
1
answer
148
views
generate pdf of each record in database table and send as attachment to email
I have 4 records in database table. The table has columns id, name, score1, score2, score3, total, email. each record has a different email. the purpose of the code is to loop through each record, ...
0
votes
1
answer
167
views
Java Email is sent with no content and not attachment when sending email from WSO2
I am trying to send email from WSO2 class mediator, when sending the email with no attachment it works fine but when sending with attachment I get the following exception:
javax.mail....
0
votes
0
answers
48
views
What causes 'java.lang.NoSuchMethodError' when using com.sun.mail in JavaMailSender?
i got exeption when i try use JavaMailSender for send text with smtp google.
There is dependencies in my projcet:
Config EmailSender:
Thre is implementation of message sending logic:
import org....
0
votes
1
answer
127
views
Spring Integration flow for consuming gmail messages with file attachments, by example
Spring Integration 5.x here. I am trying to write an IntegrationFlow that:
Reads emails from a Gmail account. If the emails do not contain file attachments, they are ignored and simlpy marked as &...