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

Discussion in 'Android Questions' started by MikeSimpson, Mar 23, 2015.

  1. MikeSimpson

    MikeSimpson Member Licensed User

    Hello,

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

    ... 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 ...

    ... 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?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you sending the exact same text from Outlook?

    The first error is related to a problem with your mail server certificate.
     
  3. MikeSimpson

    MikeSimpson Member Licensed 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.
     
    Erel likes this.
  4. MikeSimpson

    MikeSimpson Member Licensed 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.
     
  5. Pizza The Hut

    Pizza The Hut New Member Licensed 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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice