Synapse SMTP problem lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- xinyiman · 2011-04-01 08:48 procedure TForm1.Button1Click(Sender: TObject); begin   MailSender; end; procedure TForm1.OnStatus(Sender: TObject; Reason: THookSocketReason;   const Value: string); begin     if (Reason = HR_WriteCount) and (StrToIntDef(Value, 0) > 10) then     begin       FPos := FPos + StrToIntDef(Value, 0);       Application.ProcessMessages;       Caption:=IntToStr(FPos);     end; end; procedure TForm1.MailSender; var   StrList : TStringList;   hdAttach : string;   Mime : TMimeMess;   SMTP : TSmtpSend; begin   StrList := TStringList.Create;   Mime := TMimeMess.Create;   SMTP := TSmtpSend.Create;   try     SMTP.FullSSL := True;       // Explicit     //SMTP.AutoTLS := TRUE;     // implicit     SMTP.TargetPort := edtPort.Text;   //SSL:465     SMTP.UserName := edtUserID.Text;     SMTP.Password := edtPassword.Text;     SMTP.TargetHost := edtServer.Text;     SMTP.Sock.OnStatus := @OnStatus;     //SMTP LOGIN     if not SMTP.Login then exit;     StrList.Add(memBody.Lines.Text);     Mime.Header.CharsetCode := UTF_8;     Mime.Header.From := edtFrom.Text;     Mime.Header.ReplyTo := edtReply.Text;     Mime.Header.ToList.Add(edtTo.Text);     Mime.Header.CCList.Add(edtCC.Text);     Mime.Header.Subject := edtSubject.Text;     Mime.AddPartMultipart('', Nil);     Mime.AddPartText(StrList, Mime.MessagePart);     hdAttach := edtAttach.Text;     if hdAttach <> '' then       Mime.AddPartBinaryFromFile(hdAttach, Mime.MessagePart);     Mime.EncodeMessage;     if not SMTP.MailFrom(edtFrom.Text, Length(Mime.Lines.Text)) then exit;     if not SMTP.MailTo(edtTo.Text) then exit;     if not SMTP.MailTo(edtBCC.Text) then exit;      if not SMTP.MailData(Mime.Lines) then exit;     //SMTP.Logout;   finally     SMTP.Logout;     StrList.Free;     Mime.Free;     SMTP.Free;   end; end; Because this example does not work? The compilation is done but then you need to login here: if not SMTP.Login then exit; ---------------------------------------------------------------------- Graeme · 2012-07-16 10:53 > if not SMTP.Login then exit; Did you step into the SMTP.Login call to see where it fails?  Your most likely cause is because you enabled SSL/TLS, but didn't include one of the SSL units which initializes the Synapse SSL capabilities. eg: Add the "ssl_openssl.pas" unit to your uses clauses and try again.