kostenloser Webspace werbefrei: lima-city


PHP mail address bounce check

lima-city: kostenloser WebspaceForumProgrammiersprachenPHP, MySQL & .htaccess

  1. Autor dieses Themas

    brighid83

    Benutzer, kostenlos Webspace Ketzer

    30 Gulden

    0 positive Bewertungen
    0

    brighid83 hat kostenlosen Webspace.

    Greetings to all supervisors and members
    I accidentally discovered that our beloved website (lima-city.de) checks the email at the time of submission and checks whether the e-mail sent to it exists. ( on this link https://www.lima-city.de/usercp/phpmails)
    It scans all e-mail marks (yahoo,hotmail,aol,gmail....) and bounce measures
    For this reason, I decided to program PHP page to check the email or not
    But I understand the basics in PHP only
    I decided to share the idea with you until we collaborate on this page
    I get a response from all parties impatiently
  2. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

  3. horstexplorer

    Benutzer, kostenlos WebspaceBenutzer, kostenlos WebspaceBenutzer, kostenlos Webspace Bediensteter

    1406 Gulden

    17 positive Bewertungen
    0

    horstexplorer hat kostenlosen Webspace.

    horstexplorer besitzt 1 günstige Domain.

    I do not quite understand what you plan to do. Do you try to get around the PhP-Mail-Limit? Then you should use SMTP to send your mails via PhP.
  4. Autor dieses Themas

    brighid83

    Benutzer, kostenlos Webspace Ketzer

    30 Gulden

    0 positive Bewertungen
    0

    brighid83 hat kostenlosen Webspace.

    hi horst explorer ;)
    i wanna to create page php check emails bluk exists or not

    Edit by burgi
    u means clean mail list like this web quickemailverification.com

    yes man
    But not for commercial purposes but for personal use

    Beitrag zuletzt geändert: 12.11.2017 22:54:21 von burgi
  5. horstexplorer

    Benutzer, kostenlos WebspaceBenutzer, kostenlos WebspaceBenutzer, kostenlos Webspace Bediensteter

    1406 Gulden

    17 positive Bewertungen
    0

    horstexplorer hat kostenlosen Webspace.

    horstexplorer besitzt 1 günstige Domain.

    Why should someone want to do that xD
    But thats a bit difficult.

    We can test if the input is an email. This works like that:
    $email = "my@email.com";
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
      die("Invalid email"); 
    }
    ...

    This will check if the input is stuctured like an email is. If its not, it will end the script with the message ( die(Invalid email);).

    The next step is, to check if the hostname (in my example email.com) exist. Before it can be done, we have to get the hostname from the email. The whole is working like this:
    //getting Hostname from email
    $email = "my@email.com";
    $hostnameprep = strstr($email, "@");
    $hostname = str_replace("@", '', $hostnameprep);
    //DNS check
    $dnsrecord = count(dns_get_record($hostname));
    if ($dnsrecord === 0){die("Unknown Host");}

    The next step is to check if there is a mail server under the hostname. It works like this:
    $mailserver = array();
    getmxrr($hostname, $mailserver);
    if ($mailserver[0] == ''){die("No Mailserver found");}


    There is a way to check if the email is known on the mail server, but im not sure how to do that atm.
    So to this point the code could look like this.(Its better to use functions to structure the code)

    $email = "my@email.com";
    checksyntax($email);
    
    function checksyntax($email){
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
      die("Invalid email"); 
    }
    else{checkhostname($email);}
    }
    
    function checkhostname($email){
    $hostnameprep = strstr($email, "@");
    $hostname = str_replace("@", '', $hostnameprep);
    $dnsrecord = count(dns_get_record($hostname));
    if ($dnsrecord === 0){die("Unknown Host");}
    else{checkmailserver($hostname, $email);}
    }
    
    function checkmailserver($hostname, $email){
    $mailserver = array();
    getmxrr($hostname, $mailserver);
    if ($mailserver[0] == ''){die("No Mailserver found");}
    else{sendmail($email);}
    }
    
    function sendmail($email){
    //Put your code to send the email here
    }


    Beitrag zuletzt geändert: 10.11.2017 22:06:44 von horstexplorer
  6. muellerlukas

    Kostenloser Webspace von muellerlukas

    Benutzer, kostenlos WebspaceBenutzer, kostenlos WebspaceBenutzer, kostenlos WebspaceBenutzer, kostenlos Webspace Haudegen

    5295 Gulden

    137 positive Bewertungen
    1

    muellerlukas hat kostenlosen Webspace.

    horstexplorer schrieb:
    There is a way to check if the email is known on the mail server, but im not sure how to do that atm.

    Most servers (but not all) supports this:
    1) Connect to the SMTP Server
    2) Send "HELO xyz"
    3) Send "MAIL FROM: test@example.com"
    4) Send "RCPT TO: <test2@example.com>"
    5) Validate the response

    But as already said: Does not work with alle servers. Some accept every address. So there is no secure way to tell if an adress exists.

    Beitrag zuletzt geändert: 10.11.2017 22:23:36 von muellerlukas
  7. horstexplorer

    Benutzer, kostenlos WebspaceBenutzer, kostenlos WebspaceBenutzer, kostenlos Webspace Bediensteter

    1406 Gulden

    17 positive Bewertungen
    0

    horstexplorer hat kostenlosen Webspace.

    horstexplorer besitzt 1 günstige Domain.


    1) Connect to the SMTP Server
    2) Send "HELO xyz"
    3) Send "MAIL FROM: test@example.com"
    4) Send "RCPT TO: <test2@example.com>"
    5) Validate the response


    Could work like this code here (not tested):
    $socket = fsockopen($mailserver[0], 25, $errno, $errstr);
    
    if($socket){} 
    else {die("Connection Failed");} 
    fputs($socket, "HELO xyz");
    $useless = fgets($socket); //dont know what to do with this, i leave it here :D
    
    fputs($socket, "mail from: <test@gmail.com>");
    $answer= fgets($socket);
    if ($answer == '250 2.1.0 Ok'){}
    else {die("ITS NOT OK, OMG");}
    
    fputs($socket, "rcpt to: <'.$email.'>");
    $anotheranswer= fgets($socket);
    if ($anotheranswer == "550 5.1.1 <'.$email.'>: Recipient address rejected: User unknown in virtual alias table"){die("Guess the mail is not correct");}
    else {}

    Maybe the response from fputs contains everything, from our "HELO" request, to the last one. Then we have to search for some expressions.

    Beitrag zuletzt geändert: 10.11.2017 22:52:28 von horstexplorer
  8. Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!

    lima-city: Gratis werbefreier Webspace für deine eigene Homepage

Dir gefällt dieses Thema?

Über lima-city

Login zum Webhosting ohne Werbung!