1

I'm involved in a product development, where the user register his company. once he becomes user of our product, we need to send announcements,newsletters etc. to their users on behalf his company.

for this purpose we get his company email and password, i need to validate this email is valid and he's given correct password for the email id or not. I'am thinking about two methods to validate this email and password,

  • Send a test mail with smtp authetication
  • Try to open the inbox.

I feel the first one is better than the later. because if the user given wrong passwords, there are chances it will be considered as an attack.

Any one can tell me is there any better way to validate the given email with its password.

Answers appreciated, Thanks!

4

1 回答 1

1

只需连接imap_open()并测试连接是否成功。

$resource = sprintf("{%s:%s/imap/ssl/novalidate-cert/notls/norsh}INBOX","imap.host",993);
$imap = imap_open($resource, "user", "password", OP_READONLY, 1);
if($imap) echo "it works";
于 2013-12-10T00:00:39.353 回答