[Solved] Sending email with Synapse lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- tintinux · 2026-03-19 11:21 Hi I was used to send emails with Synapse, and below is an extract of my code : 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       Smtp := TSMTPSend.Create;    Smtp.TargetHost:= Inifile.ReadString ( 'EMail', 'Server', '?');    if Smtp.TargetHost = '?' then      raise Exception.Create('SMTP ERROR (TargetHost undefined in '+Inifile.Filename+')' );    Smtp.Username:= Inifile.ReadString ( 'EMail', 'Account', '');    Smtp.Password:= Decode_password( Inifile.ReadString ( 'EMail', 'Password', ''));    Smtp.TargetPort := Inifile.ReadString ( 'EMail', 'Port', '465');    Smtp.autoTLS := Inifile.ReadBool ( 'EMail', 'AutoTLS', true);    Smtp.FullSSL := Inifile.ReadBool ( 'EMail', 'FullSSL', true );    if not Smtp.Login() then      Raise Exception.Create ('SMTP ERROR (Login) : ' + Smtp.ResultString ); Today, Smtp.Login returns FALSE and Smtp.ResultString shows : Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i * 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 ---------------------------------------------------------------------- Zvoni · 2026-03-19 11:30 What's the Value of Smtp.TargetPort AFTER Reading from the Ini-File? ---------------------------------------------------------------------- tintinux · 2026-03-19 13:09 It was a wrong value, and now I can login... Many thanks ! ---------------------------------------------------------------------- Zvoni · 2026-03-19 13:38 Quote from: tintinux on March 19, 2026, 02:09:44 pmIt was a wrong value, and now I can login... Many thanks ! ---------------------------------------------------------------------- Remy Lebeau · 2026-03-21 23:14 Quote from: tintinux on March 19, 2026, 12:21:08 pmWhat 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. Quote from: tintinux on March 19, 2026, 12:21:08 pmI 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. Quote from: tintinux on March 19, 2026, 12:21:08 pmI 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. Quote from: tintinux on March 19, 2026, 12:21:08 pmBut how can we set mailto and mailfrom ? You don't, because sending emails is not part of IMAP, only SMTP.