[Gambas-user] mime.decode seems to fail with a pdf attachment

bill-lancaster bill-lancaster at ...2231...
Sun Oct 27 10:34:35 CET 2013


I have 3 emails from the same source, each contains a pdf attachment.  Two of
the decode sucessfully to a pdf file but one has quit a bit of detail
missing when compared with the original.
Here is some simplified code to show how I'm decoding the email:-

     MailClient.Open()
     Wait
     For Each oMail In MailClient
          oMimeMessage = New MimeMessage(oMail.Message.ToString())
          If oMimeMessage.Part.Count = 3 Then File.Save(User.Home &/
oMimeMessage.Part[2].FileName & i, Mime.Decode(oMimeMessage.Part[2].Data,
oMimeMessage.Part[2].ContentEncoding))
          Inc i
     Next
     Wait
     MailClient.Close

Please note the " If oMimeMessage.Part.Count = 3 " is just a way to process
only the emails in the list that have attachments.  Also since all three
have the same filename, I've added the integer 'i' to the filename.

Hope this makes a bit of sense to the list!

The new pop3 component is working well so any advice would be welcome.

Gambas 3.4.2



--
View this message in context: http://gambas.8142.n7.nabble.com/mime-decode-seems-to-fail-with-a-pdf-attachment-tp43877.html
Sent from the gambas-user mailing list archive at Nabble.com.




More information about the User mailing list