Android Question MailParser / POP3 Problem handling attachments sent via SMTP

Antonio Ferreira

Member
Licensed User
Longtime User
I trying to use mailparser to extract a text file from an email attachment.
When the email is sent by SMTP the attachment is not save.
Attachments=(ArrayList) [], indicating no attachment.
However, when I send an email via Gmail or Outlook directly all is OK.
The email body is empty. I only want to read the attachement text file.

I've read about this problem before but couldn't find any solution for it
I read the same problem from MFfromGermany, Dec 9, 2015 thread, but i don´t know the name of the attachements file when I mailparser the email.

My code from POP_DownloadCompleted

Sub POP_DownloadCompleted (Success As Boolean, MessageId As Int, MessageText As String)
If Success = False Then
Log(LastException.Message)
Else
Log(MessageId)
'Parse the mail
Dim m As Message
m = MailParser.ParseMail(MessageText, File.DirRootExternal)
Log("ATACHEMENTS = " & m.Attachments)
Log("TITUL = "& m.Subject)
Dim t As String
t=File.ReadString(File.DirRootExternal, m.Attachments.Get(0))
Log("FILE T = " & t)
End If
End Sub

Best Regards

Antonio Ferreira
 

Attachments

  • Debug_Message_with_OUTLOOK_OK.txt
    5.1 KB · Views: 407
  • Debug_Message_with_SMTP_ERROR.txt
    3.3 KB · Views: 368

DonManfred

Expert
Licensed User
Longtime User
please use code tags when posting code
 
Last edited:
Upvote 0

Antonio Ferreira

Member
Licensed User
Longtime User
Can you post the output of Log(MessageText) ?
The log of MessageText is "Return-Path: <fernandes.ferreira777@gmail.com>"
I send you the project POP3.ZIP, The attachement file OT01002030_01.TXT and the Debug Messages with the error.
B4A version 5.2
the mail is generated by CHILKAT.DLL on a Microsoft Visual Foxpro Aplication using the GMAIL SMTP
I send a new mail with this file to Gmail for an eventual test.

Thank you Erel

Antonio Ferreira
 

Attachments

  • POP3.zip
    7.7 KB · Views: 491
  • OT01002030_01.TXT
    501 bytes · Views: 353
  • Debug_Message_with_SMTP_ERROR.TXT
    3 KB · Views: 366
Upvote 0
Top