Tag Archives: Email

Accessing Your Drop Lists

In previous parts, I covered DAC Connections, then Part 1: What You Need To Build A Drop List, Part 2: Building A Drop List, Part 3: Maintaining A Drop List and now Part 4: Accessing Your Drop Lists. 

There really is no point to having a populated zone file, if you are unable to access it for any reason or produce your own drop lists. This article will cover those who have populated the zone file, but also for those who make lots of searches to see what exists. This latter point, is more about research and mark/rights protection, as well as finding potential buyers, and part of this article will suit your needs too.

Downloading Todays List

This is the basic, downloading todays drop list, you can of course modify this to download any day you choose. 

$today = date("Y-m-d");
$query = "SELECT domain FROM `zonefile` WHERE `dropdate` = '$today';";
$result = mysql_query($query); 
$fp = fopen('php://output', 'w'); 
if ($fp && $result) {     
       header('Content-Type: text/csv');
       header('Content-Disposition: attachment; filename="'.$today.'.txt"');
       header('Pragma: no-cache');    
       header('Expires: 0');
       while ($row = mysql_fetch_row($result)) {
          fputcsv($fp, array_values($row)); 

The above will simply download todays file, I would suggest including a switch to change the date, but its up to you, how you do it. 

Searching The Database

Suppose you want to search the database and browse online, I have gone with absolute basics which is Domain and Drop Date only. A Very simple form is all that is needed.

<form id="search" method="post" action="./droplist.php">
<label for="drop" id="datelab">Search by Drop Date:</label> 
<input id="drop" name="drop" onClick="this.form.reset()"> (note todays renewal required is: <?php echo date('Y-m-d', strtotime('+ 92 days')); ?>, Suspended Date is <?php echo date('Y-m-d', strtotime('+ 60 days')); ?>)</p>
<p><label for="domain" id="domainlab">Search by Domain:</label> 
<input id="domain" name="domain" onClick="this.form.reset()"></p>
<input type="submit" name="submit" value="   SUBMIT   " /> &nbsp; <input type="reset" value="  RESET  ">

I have added some embellishments such as showing some useful dates to use for reference but these aren’t needed. I have also set it to clear the boxes when clicked to avoid crossed data on submit. 

Displaying Drop Lists and Data

Once you have submitted the search query using a form, or converted it to a GET[] rather than POST[] you need to display the results.

Firstly, you need to connect to the myql database…

$con = mysql_connect ('localhost', 'zone_zone', '9@55\/\/012D' or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ('zone_nzf) or die ('I cannot select the database because: ' . mysql_error());

I keep this in a function, with success or fail returned, but you an just bung it at the top of your file, its down to you. 

You will need to know if the form have been submitted and extract the Drop Date or Domain string.

$date = $_POST['drop'];
// drop date search code here.
} elseif($_POST['domain']) {
$doms = $_POST['domain'];
// domain search code here
} // close if drop
} //close submit

You don’t need to do this, but I always do it with any database query. Sometimes it only shows in debug mode, sometimes in the main view but I always have it in there. You’ll need to alter the Query a little for Drop Dates and Domain searches, but I’ll go with Domain Search code here.

$query=mysql_query("SELECT COUNT(*) AS `rows` FROM `zonefile` WHERE `domain` LIKE '%$domain%';");
echo "<p>This date ($date) has " . number_format($rows) . " records returns.</p>";

This is useful if you want to know how many records are returned on the given date or within the search query. You may deem it not worth while but thee codes there anyway. You should build this action in to the below code, rather than run it twice, but since you may not care how many lines I’ve omitted it below. I have also switched to dropdate search since I posted a search query above.

<table cellpadding="0" cellspacing="0" border="0">
<th width="300">Domain</th>
<th width="150">Drop Date</th>
$query = mysql_query("select * from zonefile where dropdate='$date' order by domain ASC;");
<td><strong><?php echo $data['domain'];?></strong> (<a href="http://webwhois.nic.uk/cgi-bin/webwhois.cgi?wvw7yesk=3hryr4hby3&wquery=<?php echo $data['domain'];?>">whois</a>)</td>
<td><?php echo $data['dropdate'];?></td>
<?php } // while sql fetch
} //if rows ?> 

You probably should add a switch to adjust the background of each line to make it less headache inducing to read. I’m sure there are a dozen different ways to do this, but I went quick and easy to read code.

	$row ='#888888';
}else {
	$row ='#EEEEEE';

Insert the above “if…then” statement into the “do…while” code block. Putting it there means on each iteration lalt (line alt) will change from 0 to 1 and the colour panels will change each row. Something like this would work…

<tr bgcolor="<?php echo $row; ?>">
<td><strong><font face="Courier New, Courier, monospace" color="<?php echo $fon; ?>"><?php echo $data['domain'];?></font></strong> (<a href="http://webwhois.nic.uk/cgi-bin/webwhois.cgi?wvw7yesk=3hryr4hby3&wquery=<?php echo $data['domain'];?>">whois</a>)</td>
<td><?php echo $data['dropdate'];?></td>

So thats a simple displaying a given date. How you get the date to the above page is down to you. You can either use a GET[] or a POST[] function to get the date and pass it to the code. I would use a form to feed a POST[] array and then act, but a GET[] can be useful to quickly change date…

$date = $_GET[dd];

Then call the page with “dropdate.php?dd=2016-11-24” or similar. 

Other Applications

These are just some ideas I toyed with, Domain Watchlists, you could set up a Crontab for certain keyterms, and when the application detects the keyword in any given days list, it sends an email with the domain list. 

The download script I posted at the top of this could be very easily modified for this job. 

If you have your own tag, you could create a watchlist to watch your tag and track renewals and modifications or any other tag if you stored tag data. 

How much data you store, is subject to Nominets allowance and your own personal choice.

I have a few more things to write about this, but this concludes the basics. I’ll do a summery post and perhaps put the code together in to a workable solution but 95% of all the code you need in in these files and just needs sticking together.

You should now have a 2-3gb database, populated with around 11m records, and able to produce your own drop lists.

Important Notice

Before using this or any of the code I have posted you should sanitise it and enhance security, this code is NOT meant for public use. In order to keep the code simply, it has been aimed at private access so security hasn’t been a huge concern.



Web Presence and Domain Name Branding

Mail In A BoxWeb Presence and Branding are crucial when it comes to making the most of your Virtual Real Estate. There are a few major pitfalls which I see time and again, so I thought I’d cover a few of them here.

These are presented in no major order, other than how I thought about them. I were actually prompted to write this by a the signage on curtain sided wagon I saw, which were very much like the first van image I have posted below.

Make the most of what you have, with some simple guidelines. 

Failure to Utilise

This is the biggest offender, a business or trader has a domain name, they have an email address and a business name, but none of them match up. I have seen people with www.test.co.uk and their email is [email protected] or once, the other way around [email protected] and the website www.testnorthwest.wix.com.

If you are going to use a domain name, use it for both the presence and the email address, marry them to make a pair and boost you’re memorability. 

Trading Names

Following on from marrying your email and website url, we have Trading Names. If you have a cracking domain name, why not use a trading name to capitalise on the domain powers ? 

A trading name is a name you trade by, which can be anything really, but you must also identify who you are legally. This why you will often see for example “ABC is a trading name of XYZ Limited” or “ABC Doodads trading as ZXY Widgets Limited”. This is useful if you are say DIY Limited, and want to run Roofing Specialists, Flooring Experts and Boiler Repairs as separate companies under a main brand. This is often used if the company name you wished for, were already taken. 

Implementing the above issues in real world style situation. I’m going to make up a business name, and some pretend branding just to illustrate this crucial point, the domain name is owned (at time of writing by myself).

Less than Ideal Branding


MJ & BB Electricians
0161 234 5678
[email protected]


If you see the above on the side of a van (like left) at best you may remember the domain name as its you’re geographic location and a service you may need, so some recognition exists. 

Now lets marry up the email, and website url into a cohesive pair, lets play with the layout a little and we’ll use a trading name to tie it all together. Now you tell me, which one sticks in your mind, the above van of this…

Manchester Electricians Branding

Its nearly impossible to not know what this company does, the company name reinforces the domain name / website url and the email all matches up. We’ve also increased the phone number size so its nice and easy to see. 

This isn’t really the end of your branding and presence, not by a long shot. Most of the this happens behind closed doors, you’re customers will never see how much effort and thought foes into this. Infact you, yourself may never have actually given it a seconds thought. 

E-Mail Infrastructure

If you’re a sole trader, small business or a growing medium business there is no reason not to plan some sort of basic infrastructure for your email and web presence. I’m going assume this post is being read by SMB (Small and Medium Business) and Sole Traders, so the advice is more geared towards them. Bigger business with dozens of employee’s need to use a slightly different method for contacts and potentially geographic locations maybe a factor amongst other things. I will touch on the latter issues here and there but not too much. 

First up, I always recommend a basic set of email addresses, obviously a little tweaking is needed for the exact nature of your business. Sticking with the imaginary Manchester Electricians, I would go with the following basic set up.

Business Emails
info@ManchesterElectricians – General Enquires.
quote/s@ManchesterElectricians – Quotes and Pricing Alias both plural and singular spellings to one account.
emergency@ManchesterElectricians – Emergency Aerial Problems.

Business Card Emails

The business card emails, are important as it gives customers a way to contact someone they know directly rather than a faceless company. There is nothing stopping you having all these emails copy into one inbox; multiple outbound addresses, but its about planning for the future. 

If you’re a bigger business, and expect more than half dozen employees, its worth using whole names. There will be a time when you have multiple Chris Jones and Sarah Smith employees. 


Multiple People with Same Name

This isn’t perfect, when you get to 1000s of employees you may end up with multiple Robert Jones employees, so its often best to allow those employees to go with less formal names. Not all Robert’s use Robert, they could be Rob, Bob, Bobby or similar, this allows you to keep your email addresses clean. 

There will come a time when you need to consider using a multiple notation:


Its inevitable, I would personally try to avoid using numbers, and go with:


Geo-Specific Emails

If you’ve multiple offices in different areas, then you can use specific geo markers in your emails. 


Promotional Email Addresses

Lets say you’re running a competition or special offer which is advertised in a magazine but you want to know the impact. You can use a specific email for this electronicsweekly@ManchesterElectricians and direct to the special offer / competition on ManchesterElectricians.co.uk/electronicsweekly this allows you to see the impact and direct people to more information.

This works for buses bus@ManchesterElectricians or anything else really. 

The Bottom Line

Making maximum use of your domain and email within your branding, 

Using a basic planned infrastructure from the start allows you to effectively route your emails to correct people and show a more professional presence.

Keep it simple and easy to read and you won’t go wrong. 

Van Image courtesy of Michal Zacharzewski, Mail in a Box image Courtesy of Svilen Milev