Android Tutorial Using POP3 to communicate with Android devices

luke2012

Well-Known Member
Licensed User
Longtime User
I checked :

The mail contains an attachement and the "Headers" and "Msg" have the following content :

---------------------------------------------------------------------------
<!>anywheresoftware.b4a.keywords.Common 151<!> Headers = Content-Type: text/plain; charset="utf-8"
<!>anywheresoftware.b4a.keywords.Common 151<!> Msg = [Attachments=(ArrayList) [], BCCField=, Body=
, CCField= , ContentType= multipart/mixed; boundary="asdasdwdwqd__HV_qwdqwdddwq", FromField= Risto Lite <luca.colombo75@gmail.com>
, ToField= risto.test2013@gmail.com, Subject= Risto_03/16/2013, IsInitialized=true
--------------------------------------------------------------------------

You can see that the Content-Type in the Headers is different from the Content-Type in the Msg.
The HandlePart sub check for the Content-Type in the "Headers" and fail to download the attachment.

I don't known why...
 

vukanilod

Member
Licensed User
Longtime User
Hi,

I'm having problems runing this pop example. it seemed to be working one year ago, and now there is only blank screen... Sorry for reopening the subject, but it is quite strange...
 

zekigultekin

Member
Licensed User
Longtime User
how can i solve thiss
when i writing edittext.text=m.FromField
it came like this =?iso-8859-1?q?emailadress?=<emailadress@test.com>.
i want to only mail adress. helpp me
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You will need to manually parse this string:
B4X:
Sub Activity_Create(FirstTime As Boolean)
   Dim s As String = "=?iso-8859-1?q?emailadress?=<emailadress@test.com>"
   Log (FindEmail(s))
End Sub
Sub FindEmail(s As String) As String
   Dim m As Matcher = Regex.Matcher("<([^>]*)>", s)
   If m.Find Then
      Return m.Group(1)
   Else
      Return ""
   End If
End Sub
 

caspali

Member
Licensed User
Longtime User
Sorry erel. How i can check new email arrive on pop in background with a notification?
 

BudiWang

Member
Licensed User
Longtime User
Hi Erel can u add function to get date time the server mail received the email (not based on phone time)
 

BudiWang

Member
Licensed User
Longtime User
Have it on Header

example

Received: from mailer01.example.net (mailer01.example.net [192.168.01])
by ixde-df8.example.com (Internet Inbound) with ESMTP id 44524380000AA
for <recipient@example.com>; Sat, 24 Nov 2035 11:45:15 −0500 (EST)

on the last line on received header

can u add to your mailparser function

thanks
 

ComposerB4A

Member
Licensed User
Longtime User
Hello to all, i search send directly a email (without user intervention), i try:

SMTP.Initialize("smtp.mail.yahoo.com", 465, "email123@yahoo.es","clave123","SMTP")
SMTP.To.Add("email123@yahoo.es")
SMTP.Subject = "hola"
SMTP.Body = "Hola"
SMTP.Send
...
MessageSent event not run

the question, ¿because not send the email?
 
Last edited:

Beja

Expert
Licensed User
Longtime User
Hi Erel,

Today I run the pop3 example.. I can only see a blank screen with the title: POP3 Example.
Any help appreciated.

thanks in advance.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…