Lazarus

Programming => Packages and Libraries => Lazarus Extra Components => Topic started by: RandyCuba on October 23, 2019, 03:03:07 am

Title: the package for send and recive email in Lazarus
Post by: RandyCuba on October 23, 2019, 03:03:07 am
I need someone to give me a page that is not restricted to my country (Cuba), where I can download packages for Lazarus Free Pascal, including the one that allows me to send email in Lazarus applications
Title: Re: the package for send and recive email in Lazarus
Post by: krexon on October 23, 2019, 08:32:20 am
You can use i.e. xmailer, Indy, Synapse.
Title: Re: the package for send and recive email in Lazarus
Post by: madref on January 13, 2020, 06:19:43 am
Or use this:
Code: Pascal  [Select][+][-]
  1. function VerzendMailMetBijlage (Const MailAan, Onderwerp: String; Inhoud: TStrings; Bijlage: String): Boolean;
  2. Var
  3.   Mime : TMimeMess;
  4.   P : TMimePart;
  5.   B : Boolean;
  6. begin
  7.   Mime:=TMimeMess.Create;
  8.   try
  9.     Mime.Header.ToList.Text := MailAan;
  10.     Mime.Header.ReplyTo := SenderName + '<' + SenderEMail + '>';
  11.     Mime.Header.Subject := Onderwerp;
  12.     Mime.Header.From := SenderName + '<' + SenderEMail + '>';
  13.     P := Mime.AddPartMultipart('mixed',Nil);
  14.     Mime.AddPartHTML (Inhoud,P);
  15.     Mime.AddPartBinaryFromFile (Bijlage,P);
  16.     Mime.EncodeMessage;
  17.     B := SendToRaw(SenderName + '<' + SenderEMail + '>', MailAan,
  18.               smtpHost, Mime.Lines, smtpUser, smtpPassword);
  19.     Result := B;
  20.   finally
  21.     Mime.Free;
  22.   end;
  23. end;
TinyPortal © 2005-2018