Rails 电子邮件验证的最新技术是什么? [英] What's the state of the art in email validation for Rails?
问题描述
您使用什么来验证用户的电子邮件地址,为什么?
What are you using to validate users' email addresses, and why?
我一直在使用 validates_email_veracity_of
,它实际上查询 MX 服务器.但由于各种原因,这充满了失败,主要与网络流量和可靠性有关.
I had been using validates_email_veracity_of
which actually queries the MX servers. But that is full of fail for various reasons, mostly related to network traffic and reliability.
我环顾四周,没有发现很多人用来对电子邮件地址执行健全性检查的任何明显信息.是否有维护的、相当准确的插件或 gem?
I looked around and I couldn't find anything obvious that a lot of people are using to perform a sanity check on an email address. Is there a maintained, reasonably accurate plugin or gem for this?
P.S.:请不要告诉我发送带有链接的电子邮件以查看电子邮件是否有效.我正在开发发送给朋友"功能,所以这不实用.
P.S.: Please don't tell me to send an email with a link to see if the email works. I'm developing a "send to a friend" feature, so this isn't practical.
推荐答案
在 Rails 3.0 中,您可以使用 邮件宝石.
With Rails 3.0 you can use a email validation without regexp using the Mail gem.
这篇关于Rails 电子邮件验证的最新技术是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!