B4J Question Standalone App Not Sending Email (Sending from IDE Works)

B4XDev

Active Member
Licensed User
I have an app that allows me to send email. When I run the app via the IDE and try to send the email, it sends successfully.

When I try to send it from the Standalone version, it does not work. I get this error message:

Error Message When Attempting to Send Email from Standalone App:
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
    at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
    at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
    at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at b4j/org.apache.commons.net.smtp.AuthenticatingSMTPClient.performSSLNegotiation(Unknown Source)
    at b4j/org.apache.commons.net.smtp.AuthenticatingSMTPClient.execTLS(Unknown Source)
    at b4j/anywheresoftware.b4a.net.SMTPWrapper$1.run(Unknown Source)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

I'm not using obfuscation.

Anybody know what might be happening here and how to fix it?

Thank you!
 
Solution
I have an app that allows me to send email. When I run the app via the IDE and try to send the email, it sends successfully.

When I try to send it from the Standalone version, it does not work. I get this error message:

Error Message When Attempting to Send Email from Standalone App:
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
    at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
    at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
    at java.base/sun.security.ssl.SSLTransport.decode(Unknown...

Mariano Ismael Castro

Active Member
Licensed User
I have an app that allows me to send email. When I run the app via the IDE and try to send the email, it sends successfully.

When I try to send it from the Standalone version, it does not work. I get this error message:

Error Message When Attempting to Send Email from Standalone App:
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
    at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
    at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
    at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Unknown Source)
    at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
    at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at b4j/org.apache.commons.net.smtp.AuthenticatingSMTPClient.performSSLNegotiation(Unknown Source)
    at b4j/org.apache.commons.net.smtp.AuthenticatingSMTPClient.execTLS(Unknown Source)
    at b4j/anywheresoftware.b4a.net.SMTPWrapper$1.run(Unknown Source)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.base/java.lang.Thread.run(Unknown Source)

I'm not using obfuscation.

Anybody know what might be happening here and how to fix it?

Thank you!
Check this

 
Upvote 1
Solution

bdunkleysmith

Active Member
Licensed User
Longtime User
Upvote 2

B4XDev

Active Member
Licensed User
Yes, that fixes my issue!

I should have known to search for that error message specifically instead of a general description of the problem. :-/

Thank you!
 
Upvote 0
Top