Recent

Author Topic: [Solved] Sending email with Synapse  (Read 628 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 378
    • Gestinux
[Solved] Sending email with Synapse
« on: March 19, 2026, 12:21:08 pm »
Hi

I was used to send emails with Synapse, and below is an extract of my code :

Code: Pascal  [Select][+][-]
  1.  
  2.     Smtp := TSMTPSend.Create;
  3.     Smtp.TargetHost:= Inifile.ReadString ( 'EMail', 'Server', '?');
  4.     if Smtp.TargetHost = '?' then
  5.       raise Exception.Create('SMTP ERROR (TargetHost undefined in '+Inifile.Filename+')' );
  6.     Smtp.Username:= Inifile.ReadString ( 'EMail', 'Account', '');
  7.     Smtp.Password:= Decode_password( Inifile.ReadString ( 'EMail', 'Password', ''));
  8.     Smtp.TargetPort := Inifile.ReadString ( 'EMail', 'Port', '465');
  9.     Smtp.autoTLS := Inifile.ReadBool ( 'EMail', 'AutoTLS', true);
  10.     Smtp.FullSSL := Inifile.ReadBool ( 'EMail', 'FullSSL', true );
  11.     if not Smtp.Login() then
  12.       Raise Exception.Create ('SMTP ERROR (Login) : ' + Smtp.ResultString );

Today, Smtp.Login returns FALSE and Smtp.ResultString shows :

Code: Text  [Select][+][-]
  1. * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot on host 112 ready

What does the message mean ?  Is Smtp no more supported ?

I have nearly the same with pop3send, but I can use Imap with ssl and the same credentials to get emails.

I have read that we could send emails with imap moving messages in the outbox folder.
But how can we set mailto and mailfrom ?

Thanks for help
« Last Edit: March 19, 2026, 02:10:14 pm by tintinux »
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Zvoni

  • Hero Member
  • *****
  • Posts: 3398
Re: Sending email with Synapse
« Reply #1 on: March 19, 2026, 12:30:40 pm »
What's the Value of Smtp.TargetPort AFTER Reading from the Ini-File?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

tintinux

  • Sr. Member
  • ****
  • Posts: 378
    • Gestinux
Re: Sending email with Synapse
« Reply #2 on: March 19, 2026, 02:09:44 pm »
It was a wrong value, and now I can login...

Many thanks !
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

Zvoni

  • Hero Member
  • *****
  • Posts: 3398
Re: Sending email with Synapse
« Reply #3 on: March 19, 2026, 02:38:02 pm »
It was a wrong value, and now I can login...

Many thanks !
:D :D :D ;) ;) ;) ;)
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1595
    • Lebeau Software
Re: [Solved] Sending email with Synapse
« Reply #4 on: March 22, 2026, 12:14:44 am »
What does the message mean ?  Is Smtp no more supported ?

No. You can clearly see in the message that it came from an IMAP server, not an SMTP server. You connected to the wrong IP:port.

I have nearly the same with pop3send, but I can use Imap with ssl and the same credentials to get emails.

POP3, IMAP, SMTP - they are different protocols, and require different components to access them properly.

I have read that we could send emails with imap moving messages in the outbox folder.

Nope. IMAP is a mailbox management protocol. It can only manage the content of mailboxes/folders, nothing more. It does not support sending emails in any way. SMTP is the only official way to send emails.

But how can we set mailto and mailfrom ?

You don't, because sending emails is not part of IMAP, only SMTP.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018