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.

Filter by
Sorted by
Tagged with
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"...
Shadowlight's user avatar
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 ...
Ram's user avatar
  • 435
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....
Manoj's user avatar
  • 1,484
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"; ...
Singam's user avatar
  • 463
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 ...
alex_t's user avatar
  • 81
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 ...
luizfelipetx's user avatar
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 ...
octtag's user avatar
  • 1
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: ...
Valerio Finazzo's user avatar
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: ...
acco's user avatar
  • 23
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 ...
Mr12's user avatar
  • 1
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....
acco's user avatar
  • 23
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....
Hansjörg Hofer's user avatar
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: '...
hset's user avatar
  • 1
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 ...
Azhari's user avatar
  • 565
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....
k0nditor's user avatar
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 ...
Vinayak's user avatar
  • 101
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<...
Sheldorious's user avatar
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 ...
Hong's user avatar
  • 17.9k
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 ...
ROMAN's user avatar
  • 61
-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 ...
Korey's user avatar
  • 1
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 ...
Manish Devender Chauhan's user avatar
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 ...
Manish Devender Chauhan's user avatar
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: ...
Peter Müller's user avatar
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. ...
Manish Devender Chauhan's user avatar
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....
Simon Martinelli's user avatar
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 ...
Mouhamed Ndiaye's user avatar
-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 ...
Markus Moltke's user avatar
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 ...
pikmin's user avatar
  • 43
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 ...
Hababbeldu's user avatar
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 ...
Gobanit's user avatar
  • 253
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....
aratata's user avatar
  • 1,207
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 ...
Shrey Soni's user avatar
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 ...
Yallaling Kolkur's user avatar
-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 = ...
Lone Wanderer's user avatar
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",...
ca55idy's user avatar
  • 105
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....
Arif Pepaj's user avatar
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 ...
Srinidhi Murthy's user avatar
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 ...
Tovarisch's user avatar
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 ...
petula's user avatar
  • 77
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 ...
gstackoverflow's user avatar
-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 = "...
gimhanas's user avatar
-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"; ...
orgen's user avatar
  • 170
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....
pizssn peng's user avatar
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 ...
Maddy's user avatar
  • 11
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&...
rob's user avatar
  • 11
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 ...
Tovarisch's user avatar
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, ...
mpaypal100's user avatar
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....
Mahmoud Saleh's user avatar
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....
Maksym Maksymchuk's user avatar
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 &...
hotmeatballsoup's user avatar

1
2 3 4 5
105