I'm looking for a way to allow my users to log in using just an email link, without any passwords or two-factor authentication. The idea is to have them type in their email, click a link, and they're in. However, I don't want to rely on third-party services, yet it seems excessive to set up a complete email server just to send login links. I'm planning to code this in Python, so I'm wondering if there's a lightweight solution out there.
4 Answers
Has anyone tried using Amazon Lambda for this? I’m genuinely curious! Not suggesting it, but I wonder if it might help. You could pair it with Amazon SES to handle the email sending aspect.
Honestly, if email isn’t central to your service, I’d recommend using a third-party email service. It saves you time and lets you focus on development instead of dealing with email delivery issues.
You can technically handle sending emails without a full server setup by looking up the host's MX record and connecting via SMTP. However, there's a major catch: due to the prevalence of spam, sending emails this way tends to trigger spam filters, making it likely your emails will just vanish into the ether. Plus, running your own email server comes with its own set of headaches, like managing SPF, DKIM, and DMARC records to maintain a good reputation with email providers.
Instead of setting up a whole email server, consider using an SMTP relay service. Many VPS providers offer basic SMTP that you can configure for your Python app. Just authenticate with their service and send through their infrastructure. I did this for a project last year, and it worked well. Just be cautious with the authentication part—make sure your login links expire quickly and think about rate limiting to avoid spam.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically