Valid Email Script?

sensaze

Member
Jan 29, 2017
73
7
I'm wondering if there's a script anyone has made that makes people use valid email addresses when registering? E.G they have to verify before their account is activated?

I'm doing this because I'm using a password reset script that allows you to send a password reset request to your email linked to your account.
 

sensaze

Member
Jan 29, 2017
73
7
or you can just cpanel which has smtp etc up and configured for you.
Then it's as easy as using mail function no need for phpmailer etc

I don't like cpanel, it's bloated and this doesn't solve my original query at all.
When someone registers to my retro, like when you register to a forum, I want an email to be sent to them with a link they have to click to 'verify' their account before they can login.
 

sensaze

Member
Jan 29, 2017
73
7
I think gmail after 1 Month you have to be paid, so zoho is the best and base on your own domain. I have mine but people can get your vps ip ?
If you're using SMTP and a TCP proxy they shouldn't be able to get your IP address. It's still not my point though, I want people to have to actually verify their email address is real before they can play the retro, like normal habbo.
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Setup a SMTP server, easy. Just add an enum column in your users table, that indicates whether or not the users email is verified, and then detect if its not been verified then delete the user like after 3-5 days. Simple Googling.

Sent from my SM-G928F using Tapatalk
 

sensaze

Member
Jan 29, 2017
73
7
Setup a SMTP server, easy. Just add an enum column in your users table, that indicates whether or not the users email is verified, and then detect if its not been verified then delete the user like after 3-5 days. Simple Googling.

Sent from my SM-G928F using Tapatalk
Thank you for actually understanding what it is I was wanting to do, have you perhaps got a more direct 'tutorial' on this?
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Thank you for actually understanding what it is I was wanting to do, have you perhaps got a more direct 'tutorial' on this?
(I suppose you're using IIS)


For validation:

For confirmation script whatever:


Basically, you just generate a unique token that is used for checking against the verifying link, that will be sent throughout the email, then you got a enum('0','1') column and the varchar column for storing the token in. Normally, you would use cron jobs to automatically remove non-verified users like after 3-5 days.
 

sensaze

Member
Jan 29, 2017
73
7
(I suppose you're using IIS)


For validation:

For confirmation script whatever:


Basically, you just generate a unique token that is used for checking against the verifying link, that will be sent throughout the email, then you got a enum('0','1') column and the varchar column for storing the token in. Normally, you would use cron jobs to automatically remove non-verified users like after 3-5 days.

So lets say from a security point of view, I don't want my server IP leaking, so other than actually checking that [email protected] does actually exist all I would have to do is (correct me if im wrong).

Create a new php file in my includes folder called emailcheck.php with this script:
PHP:
function myCheckDNSRR($hostName, $recType = '')
{
  if(!empty($hostName)) {
    if( $recType == '' ) $recType = "MX";
    exec("nslookup -type=$recType $hostName", $result);
    // check each line to find the one that starts with the host
    // name. If it exists then the function succeeded.
    foreach ($result as $line) {
      if(eregi("^$hostName",$line)) {
        return true;
      }
    }
    // otherwise there was no mail handler for the domain
    return false;
  }
  return false;
}

and then edit say my register.php page at the top with something like:

PHP:
<?php
    include_once 'includes/emailcheck.php';
?>
 
@gandaalfmcdaddy he's using BrainCMS, so go to there you can get email forgot password system for brain.

That is already configured correctly, I'm trying to ensure people actually sign up with a valid/working email address.
 

Users who are viewing this thread

Top