jakarta-mail

Java mail TLS authentcation

匆匆过客 提交于 2021-02-19 05:08:50
问题 I am trying to get a grasp on the fundamentals of Java Mail API and TLS. I have the following scenario: There is an STMP server that uses TLS & SSL. If I log on to this server with some client, I can send authenticated &verified e-mails without any problems. Then I try to run a web server on a different machine, that sends mail using the previously mentioned SMTP server. I still want to send TLS & SSL emails, however no matter how I configure the startup properties I get the following well

How to fix java.lang.NoSuchMethodError: sun.security.ssl.Handshaker.setApplicationProtocols([Ljava/lang/String;)

淺唱寂寞╮ 提交于 2021-02-19 03:52:30
问题 Trying to send an email I got NoSuchMethodError exception when executing transport.connect(...). I chose the same version JDK(1.8.0_251) for my project, module, Glassfish (payara), maven like on this post shows but I keep receiving the same exception. I tried to add the port to the connect method but also the same error. I checked the Gmail account which is sending emails has activated the option to be used by unsecured apps. I also tried to change the method that instance the session to

How to fix java.lang.NoSuchMethodError: sun.security.ssl.Handshaker.setApplicationProtocols([Ljava/lang/String;)

徘徊边缘 提交于 2021-02-19 03:52:13
问题 Trying to send an email I got NoSuchMethodError exception when executing transport.connect(...). I chose the same version JDK(1.8.0_251) for my project, module, Glassfish (payara), maven like on this post shows but I keep receiving the same exception. I tried to add the port to the connect method but also the same error. I checked the Gmail account which is sending emails has activated the option to be used by unsecured apps. I also tried to change the method that instance the session to

javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted

不羁的心 提交于 2021-02-08 07:57:43
问题 Mail service configuration in standalone-full-ha.xml . <subsystem xmlns="urn:jboss:domain:mail:2.0"> <mail-session name="default" jndi-name="java:jboss/mail/Default" from="sender@gmail.com"> <smtp-server outbound-socket-binding-ref="mail-smtp" ssl="true" username="User" password="password"/> </mail-session> </subsystem> The mail Session in turn references an SMTP host bound at localhost at port 465. <outbound-socket-binding name="mail-smtp"> <remote-destination host="smtp.gmail.com" port="465

javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted

穿精又带淫゛_ 提交于 2021-02-08 07:57:25
问题 Mail service configuration in standalone-full-ha.xml . <subsystem xmlns="urn:jboss:domain:mail:2.0"> <mail-session name="default" jndi-name="java:jboss/mail/Default" from="sender@gmail.com"> <smtp-server outbound-socket-binding-ref="mail-smtp" ssl="true" username="User" password="password"/> </mail-session> </subsystem> The mail Session in turn references an SMTP host bound at localhost at port 465. <outbound-socket-binding name="mail-smtp"> <remote-destination host="smtp.gmail.com" port="465

Attachement's name encoding fails

柔情痞子 提交于 2021-02-07 04:00:47
问题 I try to send an email with an attachment (A pdf file), but the receiver receives a file with a different name and without the .pdf ending. The name of the file is in Greek.. try { MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress("from@mail.com")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(mail)); message.setSubject(title,"utf-8"); // Create the message part BodyPart messageBodyPart = new MimeBodyPart(); // Now set the actual

Attachement's name encoding fails

喜欢而已 提交于 2021-02-07 03:59:40
问题 I try to send an email with an attachment (A pdf file), but the receiver receives a file with a different name and without the .pdf ending. The name of the file is in Greek.. try { MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress("from@mail.com")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(mail)); message.setSubject(title,"utf-8"); // Create the message part BodyPart messageBodyPart = new MimeBodyPart(); // Now set the actual

Attachement's name encoding fails

筅森魡賤 提交于 2021-02-07 03:59:03
问题 I try to send an email with an attachment (A pdf file), but the receiver receives a file with a different name and without the .pdf ending. The name of the file is in Greek.. try { MimeMessage message = new MimeMessage(session); message.setFrom(new InternetAddress("from@mail.com")); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(mail)); message.setSubject(title,"utf-8"); // Create the message part BodyPart messageBodyPart = new MimeBodyPart(); // Now set the actual

org.springframework.integration.mail.class cast exception changing flag on a mailmessage received with spring integration mail - imap

只愿长相守 提交于 2021-01-29 14:44:33
问题 I want to update the flag on some message on an remote imap mail folder. I'm using spring-integration-mail 4.2.6.RELEASE javamail com.sun.mail To achieve this goal i'm using an mail inbound channel adapter: <mail:inbound-channel-adapter id="mailsGiaLetteAdapter" store-uri="imaps://${maildispatcher.daemon.legalmail.user}:${maildispatcher.daemon.legalmail.password}@${maildispatcher.daemon.legalmail.imap.host}:${maildispatcher.daemon.legalmail.imap.port}/INBOX" channel="emailsGiaLetteChannel"

How to exclude transitive dependency

*爱你&永不变心* 提交于 2021-01-28 12:16:26
问题 I use JavaMail in the same project with cxf. cxf brings an older version of JavaMail which does not suit me. How to excluded? I did so: compile (group: 'org.apache.cxf', name: 'cxf-rt-bindings-soap', version: apacheCfxVersion) { exclude module: 'geronimo-javamail_1.4_spec' } But it did not help. I find in the war WEB-INF \ lib \ geronimo-javamail_1.4_spec-1.6.jar 回答1: Try this: configurations { all*.exclude module: 'geronimo-javamail_1.4_spec' } 来源: https://stackoverflow.com/questions