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

Benoît Minisini gambas at ...1...
Sun Oct 27 11:44:28 CET 2013


Le 27/10/2013 10:34, bill-lancaster a écrit :
> 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
>
>
>

Please provide the original mail so that I can look at what happens.

Regards,

-- 
Benoît Minisini




More information about the User mailing list