PLEASE HELP: Downloading attachments with GMAIL email messages lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- ramutau · 2016-12-13 08:43 Hi everyone, I am using Lazarus 1.6 r51630 FPC 3.0.0 i386-win32-win32/win64 I have managed to download gmail messages which I then store in a local Firebird database. I am using Synapse components to do this. However, I do not know how to download attachments at the same time. The relevant bit of code is: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i begin        imap.SelectROFolder(FolderList[i]);          // get last SelectedRecent messages          for j := imap.SelectedCount - imap.SelectedRecent to imap.SelectedCount do          begin          imap.FetchMess(j, MimeMess.Lines);            // deocde header and body            MimeMess.DecodeMessage;            Memo1.Lines.Add('-- ------------------------------------------------');            Memo1.Lines.Add(MimeMess.Header.From);            Memo1.Lines.Add(MimeMess.Header.Subject);            // is this multipart            spcnt := MimeMess.MessagePart.GetSubPartCount();            if spcnt > 0 then              //get all parts              for cnt := 0 to spcnt - 1 do              begin                MimePart := MimeMess.MessagePart.GetSubPart(cnt);                MimePart.DecodePart;                Memo1.Lines.Add('-----------------------');                Memo1.Lines.Append(MimePart.Primary + ' ; ' + MimePart.Secondary);              Memo1.Lines.Add('-----------------------');                setlength(s, MimePart.DecodedLines.Size);                MimePart.DecodedLines.Read(s[1], length(s));                Memo1.Lines.Add(s);              end            else              //print body              Memo1.Lines.AddStrings(MimeMess.MessagePart.Lines);          end;      end;  Does anyone have an example of code that deals with the attachment part as well? Thanks in advance for the help.