Android Question Sending email with Net Library SMTP. blocked by ISP?

MikeSimpson

Member
Licensed User
Longtime User
Hello,

I made a small app to send emails with Net Library, but I get the following error message in the Logs window...

java.security.cert.CertificateNotYetValidException: current time: Thu Jan 01 11:47:39 GMT+07:00 2015, validation time: Wed Mar 04 23:53:20 GMT+07:00 2015

... when I try to send it with my phone. But when I send it with an emulator, it is working.

I tried the same in A4J, the error message there in the Logs window is ...

Program started.
java.lang.RuntimeException: Error sending message: 554 5.7.1 Message rejected under suspicion of SPAM 1427113198-68ED08dAil-JvBmXKGD
at anywheresoftware.b4a.net.SMTPWrapper$1.run(SMTPWrapper.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
false
java.lang.RuntimeException: Error sending message: 554 5.7.1 Message rejected under suspicion of SPAM 1427113198-68ED08dAil-JvBmXKGD

... but when I use a VPN (not all VPNs work), the message will be send.

If I setup Microsoft Outlook with the same settings, it works with no problem with my ISP.

Can someone explane why it is blocked using the Net Library but not blocked using Outlook? And is there a workaround so that it will work with my ISP?
 

MikeSimpson

Member
Licensed User
Longtime User
I still don't understand why the email is blocked. But I found a work around that works.

Insted of port 465 and SMTP.UseSSL = True
I used port 587 and SMTP.StartTLSMode = True

I think the best way is to use both ways, SSL and TLS, if with SSL retruns an error than send it again using TLS.
 
Upvote 0

MikeSimpson

Member
Licensed User
Longtime User
I found another possible cause why the emails are blocked: When I try to send the email to another email account then the one I am logged in. If I send the email on myselfe with my account it is working, if I try to send another email address it's blocked.
 
Upvote 0

Pizza The Hut

New Member
Licensed User
Longtime User
I ran into some roadblocks which sound similar. A popular internet search engine will show that others outside of B4A run into this as well. As far as I can see some overactive security is blocking the traffic at the network level.

The code will throw the following error: "android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)"

The error will occurs when I am using my companies corporate network, but if I take the same Nexus7 home and connect to my wifi router it works fine, also works fine if I use my cell phone as a mobile hotspot (port 587 and StartTLSMode).

For my purposes I have moved on and used code to launch the email app (Email object, with an intent). Not as user friendly as I would like to throw up the email application, as I wanted to send an email in the background without harassing the operator.

Cheers.
 
Upvote 0
Top