Recent

Author Topic: the package for send and recive email in Lazarus  (Read 2709 times)

RandyCuba

  • Newbie
  • Posts: 1
the package for send and recive email in Lazarus
« 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

krexon

  • Jr. Member
  • **
  • Posts: 80
Re: the package for send and recive email in Lazarus
« Reply #1 on: October 23, 2019, 08:32:20 am »
You can use i.e. xmailer, Indy, Synapse.

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: the package for send and recive email in Lazarus
« Reply #2 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;
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

 

TinyPortal © 2005-2018