#1 2024-09-11 12:32:03

phss_phss
Member
Registered: 2024-08-05
Posts: 4

Help with SendEmail for Lazarus

I implemented the email service on my project in Delphi for Windows and it works:

  function TEmailService.Send : boolean;
var
  vContent: RawUtf8;
begin
  vContent := MergeTemplate;
  ValidaParametros;

  with FEmailSettings do
    Result := SendEmail(
      Host,
      User,
      FEmailTo,
      MimeHeaderEncode(StringToUtf8(FTemplate.S['Assunto'])),
      Utf8ToWinAnsi(vContent),
      Headers,
      User,
      Pass,
      Port,
      TextCharSet,
      TLS);
end;

But now I'm using a version of same project in Lazarus for linux and facing an issue, I guess it's because of missing lib:

 ESendEmail {Message:"Command failed for teste@microprocess.com.br at mail.microprocess.com.br:465 [Undefined Error]"} [TAppRestHttpSrv8083v1THttpSrvRe] at 49f1e5

What do I need to do or  wich files do I need to implement SendEmail in my Lazarus for Linux version?

Offline

#2 2024-09-11 13:36:28

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,510
Website

Re: Help with SendEmail for Lazarus

At which step is it stopping?

Does the socket connection work as expected?
Are you sure the port 465 is not blocked on your Linux environment?

Offline

#3 2024-09-12 12:39:07

phss_phss
Member
Registered: 2024-08-05
Posts: 4

Re: Help with SendEmail for Lazarus

The port 465 is not blocked. I execute on Delphi and it works, but when I execute on Lazarus don't.

Offline

#4 2024-09-12 13:07:56

ttomas
Member
Registered: 2013-03-08
Posts: 132

Re: Help with SendEmail for Lazarus

Port 465 for SMTP with SSL/TLS encryption? Do you build same app bitness (32/64). Check your dll bitness if you use openssl.

Offline

#5 2024-09-12 16:27:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,510
Website

Re: Help with SendEmail for Lazarus

Again:
At which step is it stopping?

Please try to debug a little bit.

Offline

Board footer

Powered by FluxBB