Send emails with attachments using LNET [SOLVED] lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- joaowiciuk · 2011-10-13 23:15 Hello everybody, I wonder how I can send emails with attachments using LNET (TLSMTPClientComponent and TLSSLSessionComponet). I tested the code below but it did not work: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   Stream: TMimeStream; begin   Stream := TMimeStream.Create;   Stream.AddFileSection('C:\DOCUME~1\Usuario\Desktop\log.txt');   Stream.Reset;   if not SMTP.Connected then SMTP.Connect('smtp.live.com', 25);   SMTP.StartTLS;   if SMTP.HasFeature('AUTH LOGIN') then // use login if possible     SMTP.AuthLogin('joaowiciuk@hotmail.com', '******')   else if SMTP.HasFeature('AUTH PLAIN') then // fall back to plain if possible     SMTP.AuthPlain('joaowiciuk@hotmail.com', '******');   //SMTP.SendMail(EditFrom.Text, EditTo.Text, EditSubject.Text, FMimeStream); -> send the stream   SMTP.SendMail('joaowiciuk@hotmail.com', 'joaowiciuk@hotmail.com', 'Teste', Stream); // send the stream end; when I click the button nothing happens and the mail does not reach to my inbox or junk folder. ---------------------------------------------------------------------- nopain180 · 2011-10-21 05:01 According to smtphotmail.com, you can use ssl. Have you tried ssl? Port 587? ---------------------------------------------------------------------- joaowiciuk · 2011-10-21 15:34 Thanks dude, but I already discovered how solve my problem. http://lazarus.freepascal.org/index.php/topic,14958.msg79811.html#msg7 9811 ---------------------------------------------------------------------- BigChimp · 2011-10-21 19:00 If you've already solved your problem, maybe a good idea to mark the thread subject as [SOLVED].... ---------------------------------------------------------------------- nopain180 · 2011-10-22 05:00 Didn't see your other thread. Glad you got it straightened out.