Android Tutorial Using POP3 to communicate with Android devices

Beja

Expert
Licensed User
Longtime User
also tried pop.gmail.com and got this:
java.net.UnknownHostException: pop.gmail.com
 

Beja

Expert
Licensed User
Longtime User
Thanks Erel,
In fact I use real device except in rare cases when I use the emulator..
Any other suggestion appreciated.
 

Beja

Expert
Licensed User
Longtime User
Hi Erel,
This is the only line I modified:
pop.Initialize("pop.google.com", 995, "user@example.com", "password", "pop")

I could use the Internet for all other purposes.
 

IslamQabel

Active Member
Licensed User
Longtime User
Hi Erel:
Unfortunately, i receive the following error message
*** Remote compilation mode ***
Parsing code. 0.02
Compiling code. 0.02
Compiling layouts code. 0.00
Sending data to remote compiler. Error
step: Compiling generated Java code.
javac 1.7.0_09
src\anywheresoftware\b4a\samples\pop3\main.java:267: error: package anywheresoftware.b4a.net does not exist
public static anywheresoftware.b4a.net.POPWrapper _pop = null;
^
1 error
 

IslamQabel

Active Member
Licensed User
Longtime User
Dear All......I am using a program that you can send email using SMTP ......The user have to enter the password in text box, so i want to display the entered password as **************** to hide what written how to do it???

Thanks
 

tactic1960

Member
Licensed User
Longtime User
Hi Erel, i used MailParser for save an attachment by i have then same problem of Luke2012. I send the mail with SMTP perfectly, receive the same mail with POP3 but MailParser don't save the file.
I have debugged MailParser and i have see the problem,the function ParseMultipartBody fails.
I attach a file with the mail, if you debug can see the problem

Thanks
 

Attachments

  • mail.txt
    9.7 KB · Views: 456

Erel

B4X founder
Staff member
Licensed User
Longtime User
It misses the closing boundary.
Change ParseMultiparyBody to:
B4X:
Sub ParseMultipartBody (Mail As String, Msg As Message)
   'find first boundary
   index = Mail.IndexOf2("--" & boundary, index)
   ReadNextLine(Mail)
   Dim headers As StringBuilder
   headers.Initialize
   Do While index < Mail.Length
     Dim line As String
     line = ReadNextLine(Mail)
     If line.Length > 0 Then
       headers.Append(line).Append(" ")
     Else If index < Mail.Length Then
       Dim nextPart As Int
       nextPart = Mail.IndexOf2("--" & boundary, index)
       If nextPart = -1 Then nextPart = Mail.Length + 4 '<-- new line
       If nextPart-4 > index Then
         HandlePart(headers.ToString, Mail.SubString2(index, nextPart-4), Msg)
       End If
       index = nextPart
       ReadNextLine(Mail)
       headers.Initialize
     End If
   Loop
End Sub
 

le_toubib

Active Member
Licensed User
Longtime User
hi all
i m trying this method to communicate with other devices, using gmail, but the error log says i need to web login first ,
indeed i dont to give the username n password to my users to login (that wouldnt even work new gmail security restrictions)
my questions : what are the other free email servers that can work seemlessly with the good old username and password method) using net library without user interference
 

le_toubib

Active Member
Licensed User
Longtime User
Yes, and enabled pop3 from gmail settings ... Smtp works fine (with security alerts ask the time) but Pop3 requires web login first then it works
 

le_toubib

Active Member
Licensed User
Longtime User
I tried yandex for that purpose , it worked after enabling pop3 without requiring web login
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…