已在Spring Boot / Security注册中验证电子邮件

时间:2017-10-31 10:30:27

标签: spring-boot spring-security

如何验证注册期间提供的电子邮件是真实的?确认链接是一个显而易见的选择,但我看到网站在您点击“注册”后立即发生某种电子邮件验证。如果电子邮件是假的,则该过程将停止。怎么能在Spring完成? (例如:safaribooksonline)

2 个答案:

答案 0 :(得分:1)

您必须检查邮件是否被退回。如果是,则不是有效的电子邮件。您可以在java中使用neverbouncehere is the github link提供的API。

答案 1 :(得分:0)

您可以尝试使用MailboxValidator API。

只需在https://www.mailboxvalidator.com/plans#api

注册免费的API密钥即可

然后,您可以使用https://github.com/MailboxValidator/mailboxvalidator-java上的Java代码或使用Maven https://mvnrepository.com/artifact/com.mailboxvalidator/mailboxvalidator-java/1.0.0