It is possible to use your own mail-server to deliver mail directly to other mail-servers (i.e. your very own smtp-server) but you need to know that if you don't setup it correctly your server will be marked as spam-server by other mail-servers and your mail might bounce back (or even worse... just not delivered). Setting up your own mail-server is very precise task and you need to do it the correct way.
For using the smtp of your own internet-provider. Some have larger limitations but if your going to send thousands of mail per batch you might want use a specialized smtp-service for that. For example
Amazaon SES but I'm sure there are many, many others (
http://www.serversmtp.com is another. Try Google.). But if I spread-out my mails over a few hours my own internet-provider doesn't have a problem with a few thousand mails via their smtp-server. Sending them in a time-span of minutes might be another matter.
B.T.W. Is there a special reason you want to do this in code in Lazarus/FPC? You could, for instance, also go for a service like
MailChimp. With the free account you can send up to 12.000 mails to 2000 subscribers each month (with only a small non-intrusive mailchimp-icon at the bottom). If you need more you can pay a modest fee for more (and without the icon). You can design the mail online and create Email-campaigns.