I’ve used ssmtp on Linux servers in the past. It’s a good tool that does that one task well.
This is a touch of an advanced setup your seeking. You’re going to need some foundational skills to get there, my guy. See the attached link. It might seem off topic but it’ll introduce you to a practical way of getting those skills… & help you have a backup to recover from should it break something: