

Without getting too critical of your code (congrats BTW), never use strcpy
instead use strlcpy
.
strcpy
will happily allow you to create buffer overflows (a common challenge with C) which will cause your application to crash.
You’ll find more details here.
Good luck!
OP, what bluGill said is exactly your problem (assuming your DMARC and friends are setup correctly).
The concept is referred to as “email (or domain) reputation”. The implementation details are closely guarded secrets, unique for each email receiver.
One of the metrics for establishing a positive email reputation the “How much email does your mail server sends?” : the more the better**
If you’re a large company, it’s fine… but if it’s just a personal domain with < 20 per week, you’re not going to establish a reputation and (depending on the receiver) you’re email might just get dropped.
The other (frequent) metric is: “Of the emails that are sent, how many are read, and how many are flagged as spam?” In order, for these crowd sourced spam filters to work, they need you to send large amounts of email. Receivers like Gmail/Google are pretty forgiving. However, Outlook/Microsoft are very aggressive, meaning if enough outlook users flag your email as Spam, then future emails sent to outlook from your domain will probably automatically be marked as spam. Obviously, these are all black boxes, so I can only offer my personal observations (take it worth a grain of salt).
As bluGill mentioned, there is a solution, but it involves moving your custom domain to a larger (re: paid) email provider. If you were to move to Google (for example), it doesn’t matter if your custom domain sends 5 emails per week. Those 5 emails are being sent from Google mail servers (using your custom domain) , which means they’re gaining the “reputation” of google and you can be certain that your emails will arrive, even if it’s (non-obvious) spam. Because, the email receiver assumes that Google will shut you down, if you’re a spammer.
It’s a sad state that one of the original “pillars of the internet” (email) has degraded to feed only the big tech companies… but unfortunately this has been the case for many years.