How to find email address from a website url

Authors: CodeToday | PHP Code | Views: 701 | Posted: 05 AM: 09/05/2017

How to find email address from a website urlIn this article I will guide you to get email address directly from the website url, this is important if you want to have a quality email list. You can also use the foreach loop to get multiple website urls at once

See AlsoHow to Find email address from bulk domain names
                 How to get Social Networks from a Website

The basic knowledge you must have in this article is

1. Curl_init ()function
2. Regular expression preg_match_all
3. Foreachfunction

curl_init () function  (function.php)

function fread_url($url,$ref="")
            $ch = curl_init();
            $user_agent = $_SERVER['HTTP_USER_AGENT'];
            curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
            curl_setopt( $ch, CURLOPT_HTTPGET, 1 );
            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
            curl_setopt( $ch, CURLOPT_FOLLOWLOCATION , 1 );
            curl_setopt( $ch, CURLOPT_FOLLOWLOCATION , 1 );
            curl_setopt( $ch, CURLOPT_URL, $url );
            curl_setopt( $ch, CURLOPT_REFERER, $ref );
            curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
 	    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);     
	    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
            $html = curl_exec($ch);
            $hfile = fopen($url,"r");
	    $html = str_replace('<b>','',$html);
	    $html = str_replace('</b>','',$html);
	    $html = str_replace('<br>','',$html);
	    $html = str_replace('<strong>','',$html);
	    $html = str_replace('</strong>','',$html);		
        return $html;


If you want to format the form under bootstrap you can add a bootstrap library, otherwise you can use your format.

<link rel="stylesheet" href="">
include "function.php";
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How to find email address from a website url</title>
<link rel="stylesheet" href="">
<div class="container">
<h1>How to find email address from a website url</h1>
<form action="" method="post" class="form-horizontal">
<div class="form-group">
<input type="text" name="domain" id="domain" value="<?=$_POST['domain']?>" class="form-control" placeholder = "Enter website url here ..." required/>
<div class="form-group">
<button type="submit" name="submit" class="btn btn-info">Extract Now</button>

$url  = $_POST['domain'];
$text = fread_url($url);				
$resEmail  = preg_match_all("/[a-z0-9_-+][email protected][a-z0-9-]+.([a-z]{2,3})(?:.[a-z]{2})?/i",strtolower($text),$matches);
if ($resEmail) { 		   
	foreach($matches[0] as $email) { 
		$emailList[] = $email;
$emailLists = @array_unique($emailList);

If you have any questions, please leave a message below