Recent

Author Topic: How Send Email (Gmail, Hotmail, Yahoo)  (Read 31770 times)

luk2009

  • Jr. Member
  • **
  • Posts: 51
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #15 on: May 31, 2018, 02:22:57 pm »
Thanks for your answers

cgd

  • Newbie
  • Posts: 6
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #16 on: August 04, 2019, 07:36:12 pm »
Thank you so much for this topic... I was several days trying to understand why my old routines to send emails stopped working since some months... the SSL and TLS properties need to be defined nowadays to work with many email providers.

I use Lazarus 1.6, FreePascal 3.0.0

My email example program is working now in Windows10, 32b. But I also have to compile it in Ubuntu 32bits and Raspbian Stretch for Raspberry ARM... (I didn't do that yet)

Questions: do I have to provide dlls for OpenSSL with my Raspberry application? In affirmative case, which ones? (I see librarys por Windows and Linux, could I use the Linux ones for Raspbian?)

Thank you very much !!

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #17 on: August 04, 2019, 11:15:33 pm »
cgd

xmailer uses the synapse libraries so you must have them installed on your windows box - you can use the same files on your linux boxes

they will be bel recompiled for linux when you compile your xmailler program

the synapse files will also work on the rpi

you probably already have the linux openssl files on your linux boxes - if not they are very easy to install
« Last Edit: August 04, 2019, 11:19:44 pm by toby »

cgd

  • Newbie
  • Posts: 6
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #18 on: November 07, 2019, 09:24:11 pm »
xmailer is working great for me in win xp 32bits, win 10 64 bits, and raspbian stretch (raspberry pi3B+)!!
I still did not tested in ubuntu 32 and 64 bits...

Question: Has anyone used xmail to send an email with a html body? Could share a simple example of how to?
Thank you very much!

cgd

  • Newbie
  • Posts: 6
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #19 on: November 07, 2019, 10:06:09 pm »
I got it... it's simple:

function MailSimple(.....)
Var
    Mail : TSendMail;
begin
    ...
    ...
      Mail.ContentType := ctTextPlain ;    //for plain text
   //or
      Mail.ContentType := ctTextHTML ;   //for html text
   ...
end;

Ericktux

  • Sr. Member
  • ****
  • Posts: 384
    • ericksystem software
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #20 on: October 20, 2024, 06:03:35 am »
Currently today 10/19/2024 I can no longer send emails  :(, I attach the error images that appear, if someone manages to use it or solve it please can you help me here
I love desktop software
https://www.ericksystem.com

Thaddy

  • Hero Member
  • *****
  • Posts: 18707
  • To Europe: simply sell USA bonds: dollar collapses
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #21 on: October 20, 2024, 07:45:26 am »
Version of your crypto lib(s) are too old, so the authentication fails. Your are probably using a crypto lib version (any, e.g. openssl) that does not support tls 1.3, although 1.2 might still work.
This is an ever recurring problem and I have posted this or similar answers in their hundreds.
See wikipedia:
https://en.wikipedia.org/wiki/Version_history_for_TLS/SSL_support_in_web_browsers
and https://developer.mozilla.org/en-US/docs/Glossary/TLS
For good measure, this goes for ALL browsers, not just Firefox.
https://support.mozilla.org/en-US/kb/secure-connection-failed-firefox-did-not-connect
« Last Edit: October 20, 2024, 07:53:20 am by Thaddy »
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #22 on: October 20, 2024, 09:01:04 am »
In general, it is Google that has blocked the ability to send emails when authenticating with a login and password. You must use OAuth or set up an additional password for the app: https://support.google.com/a/answer/9003945
Best regards / Pozdrawiam
paweld

silvercoder70

  • Full Member
  • ***
  • Posts: 200
    • Tim Coates
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #23 on: October 20, 2024, 11:19:49 am »
Think that hotmail (office etc.) also require OAuth2 today as well.
🔥 Pascal Isn’t Dead -> See What It Can Do: @silvercoder70 on YouTube

Ericktux

  • Sr. Member
  • ****
  • Posts: 384
    • ericksystem software
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #24 on: January 08, 2026, 01:35:42 am »
Hello friends, happy new year! I have a question: has anyone been able to find a way to send emails these days?
I love desktop software
https://www.ericksystem.com

Ericktux

  • Sr. Member
  • ****
  • Posts: 384
    • ericksystem software
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #25 on: January 08, 2026, 03:11:35 am »
Hi friends, today, January 7, 2026, I managed to send emails very easily  :D. Here's how:
1. First, create an "app password" from your Google account. Here's the direct link:
https://myaccount.google.com/apppasswords

2. Give it any name, and your "app password" will be generated.
3. Now, just enter it instead of your current password. See the example:

Code: Pascal  [Select][+][-]
  1. program demo;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   XMailer, SysUtils;
  7.  
  8. var
  9.   Mail: TSendMail;
  10. begin
  11.   Mail := TSendMail.Create;
  12.   try
  13.     Mail.Sender := 'Erick <erick1@gmail.com>';
  14.     Mail.Receivers.Add('micliente@gmail.com');
  15.  
  16.     Mail.Subject := 'Prueba de envío';
  17.     Mail.Message.Add('Este correo fue enviado correctamente.');
  18.  
  19.     Mail.Smtp.UserName := 'erick1@gmail.com';
  20.     Mail.Smtp.Password := 'HERE_YOUR_APP_PASSWORD';
  21.     Mail.Smtp.Host := 'smtp.gmail.com';
  22.     Mail.Smtp.Port := '587';
  23.     Mail.Smtp.SSL := False;
  24.     Mail.Smtp.TLS := True;
  25.  
  26.     Mail.Send;
  27.     WriteLn('E-mail sent successfully!');
  28.   except
  29.     on E: Exception do
  30.       WriteLn('Error: ', E.Message);
  31.   end;
  32.  
  33.   Mail.Free;
  34. end.

This might be helpful:

Code: Pascal  [Select][+][-]
  1. //TLS – puerto 587
  2. Mail.Smtp.UserName := 'erick1@gmail.com';
  3. Mail.Smtp.Password := 'HERE_YOUR_APP_PASSWORD';
  4. Mail.Smtp.Host := 'smtp.gmail.com';
  5. Mail.Smtp.Port := '587';
  6. Mail.Smtp.SSL := False;
  7. Mail.Smtp.TLS := True;
  8.  
  9. // SSL – puerto 465
  10. Mail.Smtp.UserName := 'erick1@gmail.com';
  11. Mail.Smtp.Password := 'HERE_YOUR_APP_PASSWORD';
  12. Mail.Smtp.Host := 'smtp.gmail.com';
  13. Mail.Smtp.Port := '465';
  14. Mail.Smtp.SSL := True;
  15. Mail.Smtp.TLS := False;

✔ What it CAN do:
Send emails via SMTP
Receive via IMAP (if used)
Works 24/7
Doesn't ask for confirmations or pop-ups

Even though the password works perfectly, Gmail does limit sending:
~500 emails/day (personal accounts)
~2000 emails/day (Google Workspace)
Limit per minute (anti-spam)
Repetitive content → suspicious

PD: I downloaded the DLL files from here (libeay32.dll and ssleay32.dll of 32bits)
https://indy.fulgan.com/SSL/

espero les pueda ayudar mi aporte, saludos amigos  :)
« Last Edit: January 08, 2026, 03:36:45 am by Ericktux »
I love desktop software
https://www.ericksystem.com

delphius

  • Jr. Member
  • **
  • Posts: 83
Re: How Send Email (Gmail, Hotmail, Yahoo)
« Reply #26 on: January 08, 2026, 01:02:45 pm »
Hello friends, happy new year! I have a question: has anyone been able to find a way to send emails these days?

This is all good, with the help of XMailer and OpenSSL.
Try it without them)
fpmtls - ssl/tls 1.3 implementation in pure pascal
fpmailsend - sending a simple email message
pascal-webui - use web browser as gui and fpc as backend

 

TinyPortal © 2005-2018