Jump to content

Email Authentication


elmas156

Recommended Posts

Hello everyone,

 

I have a site where users sign up using an email address as their username.  I want to be able to verify that their email address is valid without having to send them a confirmation email that they have to click some link in before they are allowed to sign in to the website.  Maybe something that pings the email server for a specific address, and if the address is not valid, alert the user to enter a valid address.  Does anyone have any ideas or information that you could point me to to assist me with this task?  Thanks in advance for any help or ideas.

Link to comment
Share on other sites

You can connect to the mail server with SMTP and ask to send an email to that address, then cancel.  It's not guaranteed to work but it's better than nothing.  Keep in mind that you need to look up the MX DNS record for a domain to find where to connect to - if you just connect to the domain itself you might not find the SMTP server there and you'll get a false negative result for the test.

 

There's an overview of the SMTP protocol in this article: http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

MX records: http://en.wikipedia.org/wiki/MX_record

 

Yes it's complicated - that's why most sites send an email instead :)

Link to comment
Share on other sites

I'll also add that for my personal domain I use a "redirect" address. For example, any email sent to me@mydomain.com will be redirected to me@myispdomain.com. So, trying to "validate" my email will fail.

 

I agree with Pikachu2000. Simply validating that they have supplied a valid email address tells you nothing.

Link to comment
Share on other sites

OK, so I guess I'm going to be sending a confirmation email.  Here is another question though:  When an email is automatically sent using the mail() function, sometimes it takes up to 10-15 minutes.  Is there any way to speed that up or does it have something to do with my server?  I would like for it to take no more than 5 minutes, ideally less than 2 minutes.  Ideas on this?

Link to comment
Share on other sites

mjdamato, why would validation fail for the redirect address?  If email can be sent to me@mydomain.com, then the MX for mydomain.com must be accepting mail addressed to "me".

 

I can only say that I have had problems receiving emails to certail addresses from certain domains and the only parameter I could not rule out was that the accounts experiencing the problem were redirects. I assumed - possibly incorrectly - was that the sneding server was doing some type of check.

Link to comment
Share on other sites

They probably have a queue for a reason. Your best bet would be to ask them exactly what the situation is and if there's a way around it.

 

Failing that, you could send the email using a different email provider and not use PHP's mail function. I've had a good experience with Swiftmailer before. You could probably use it to send through gmail (500 email per day limit) or some other provider.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.