Android Question android.system.ErrnoException: connect failed: ENETUNREACH (Network is unreachable)

Zeev Goldstein

Active Member
Licensed User

i'm trying to send email from my app using gmail
on one phone it works
on the other one i get this error

both are android 9.1

this email account is set for low security so i can use it without 2 factors or gmail auth api

as said - one phone works perfectly on other i get this error

BTW - i get all permissions etc...

anyone can open my eyes ?


Zeev Goldstein

Active Member
Licensed User
Are you sure that the problematic device is connected to the internet?

Try to add this to the manifest editor:
CreateResourceFromFile(Macro, Core.NetworkClearText)
thanks for your reply
yes - device is connected to the internet ans has full signal

the line you suggested made no change and i keep getting the same error

Zeev Goldstein

Active Member
Licensed User
i did try browsing to a few urls - all worked
there is no other error - the error i get is the one in the post title

i just try to send a simple email through gmail smtp - as said on one device works like charm on another one not and i get this error

Zeev Goldstein

Active Member
Licensed User
and this is the code i use

Sub SendEmail()
    Dim mail As SMTP
    Dim SMTP_SSL_Port As Int = 465    'for SSL
    Dim SMTP_TLS_Port As Int = 587    'for TLS

        mail.Initialize("", 465, "", "MyPassword", "SMTP")
        Dim M As Map
        M.Put("From","MySelf <>")
        mail.AdditionalHeaders = M

        mail.Subject = "SMTP_Subject"
        mail.Body = "SMTP_Body"
        mail.AddAttachment(fPath, fName)
        Wait For smtp_MessageSent(Success As Boolean)
        If Success = True Then
            ToastMessageShow("Message sent successfully", True)
            ToastMessageShow("Error sending message", True)
        End If

    End Try
End Sub

Zeev Goldstein

Active Member
Licensed User
That's odd
Both phones are side by side
Both have full internet access
One works one doesn't
I've checked on wifi and on cellular
What else can i check or do?

Zeev Goldstein

Active Member
Licensed User
Found the problem & easily resolved.
There was nothing wrong in the app or phone or network.
I have adguard and it was blocking network access.
Marked the app as safe and voila it works like charm.
Silly me..
Thank you all who tried to help