Generally, no, unless you don’t care whether it’s delivered or not
Too many people and companies abused this to the point that running your own mail server means much of the generic mail you send will end up in junk/spam folders.
What would prevent delivery? I do some work for a small organization and we send out registration confirmations with a self-hosted webserver. I am not aware of any delivery problems there. Thats why I was surprised. Are we just lucky?
For a login link, I wouldnt really care if its in the spam folder. The person is actively looking for the mail, surely they will find it? It's different for marketing or similar content, but for expected mail, I wouldn't care.