
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP, Web and IT stuff &#187; forms</title>
	<atom:link href="http://www.webdigi.co.uk/blog/tag/forms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdigi.co.uk/blog</link>
	<description>Little words of wisdom</description>
	<lastBuildDate>Sat, 04 Sep 2010 22:35:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to check if an email address exists without sending an email?</title>
		<link>http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/</link>
		<comments>http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 14:24:04 +0000</pubDate>
		<dc:creator>php-manual</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.webdigi.co.uk/blog/?p=19</guid>
		<description><![CDATA[We have all been doing email address validation for a very long time to make sure that the email is correctly formatted. This is to avoid users entering wrongly formatted email address but still they can accidentally give us a wrong email address.
Example of a correctly formatted email address but still wrong:
mailbox.does.not.exist@reddit.com [VALID email fromat [...]]]></description>
			<content:encoded><![CDATA[<p>We have all been doing email address validation for a very long time to make sure that the email is correctly formatted. This is to avoid users entering wrongly formatted email address but still they can accidentally give us a wrong email address.</p>
<p style="text-align: left;">Example of a correctly formatted email address but still wrong:</p>
<p style="text-align: center;"><strong>mailbox.does.not.exist@reddit.com</strong> [VALID email fromat but still not correct]</p>
<p style="text-align: left;">Above case specifically happens when you take important customer email on phone and you type in the wrong email. So is there a QUICK solution to really check the email without sending a test message to the user? Yes.<br />
<span id="more-19"></span></p>
<p><span style="text-decoration: underline;">The solution</span></p>
<p style="text-align: left;">A quick &amp; simple check below can be implemented in most programming language including PHP, Python etc. It relies on using the same SMTP which is used to send emails.</p>
<p>To check if user entered email <strong>mailbox.does.not.exist</strong><strong>@reddit.com</strong> really exists go through the following in command prompt.</p>
<p><strong>First </strong>- Find mail exchanger of reddit.com</p>
<p style="padding-left: 30px;">COMMAND:<br />
nslookup &#8211; q=mx reddit.com<br />
RESPONSE:<br />
reddit.com      MX preference = 10, mail exchanger = mail.reddit.com<br />
mail.reddit.com internet address = 208.96.53.70</p>
<p style="text-align: left;"><strong>Second </strong>- Connect to mail server mail.reddit.com</p>
<p style="text-align: left; padding-left: 30px;">COMMAND:<br />
telnet mail.reddit.com 25<br />
RESPONSE:<br />
220 mail.reddit.com ESMTP Postfix NO UCE NO UEMA  C=US L=CA Unsolicated electronic mail advertisements strictly prohibited, subject to fine under CA law CBPC 17538.45.  This electronic mail service provider&#8217;s equipment is located in the State of California.  See http://www.reddit.com/static/inbound-email-policy.html for more information.</p>
<p style="text-align: left; padding-left: 30px;">COMMAND:<br />
helo hi<br />
RESPONSE:<br />
250 mail.reddit.com</p>
<p style="padding-left: 30px;">COMMAND:<br />
mail from: &lt;youremail@gmail.com&gt;<br />
RESPONSE:<br />
250 2.1.0 Ok</p>
<p style="padding-left: 30px;">COMMAND:<br />
rcpt to: &lt;mailbox.does.not.exist@reddit.com&gt;<br />
RESPONSE:<br />
<strong>550 </strong>5.1.1 &lt;mailbox.does.not.exist@reddit.com&gt;: Recipient address rejected: User unknown in local recipient table</p>
<p style="padding-left: 30px;">COMMAND:<br />
quit<br />
RESPONSE:<br />
221 2.0.0 Bye</p>
<p>NOTES:</p>
<p>1) the <strong>550 </strong>response indicates that the email address is not valid and you have caught a valid but wrong email address. This code can be on the server and called on AJAX when user tabs out of the email field.  The entire check will take less than 2 seconds to run and you can make sure that the email is correct.<br />
2) If email was present the server will respond with a 250 instead of 550<br />
3) There are certain servers with a CATCH ALL email and this means all email address are accepted as valid on their servers (RARE but some servers do have this setting).<br />
4) Please do not use this method to continuously to check for availability of <span>gmail</span> / yahoo / <span>msn</span> accounts etc as this may cause your IP to be added to a blacklist.<br />
5) This is to supplement the standard email address javascript validation.</p>
<p><span style="text-decoration: underline;">Telnet screenshot in windows &#8211; Check email using SMTP commands</span></p>

<a href='http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/checkemailtelnet/' title='Telnet on windows to check mail server using SMTP commands'><img width="150" height="150" src="http://www.webdigi.co.uk/blog/wp-content/uploads/2009/01/checkemailtelnet-150x150.png" class="attachment-thumbnail" alt="" title="Telnet on windows to check mail server using SMTP commands" /></a>

<p><strong><span style="text-decoration: underline;">UPDATE: PHP code added on 26th January 08</span></strong></p>
<p>1) <a rel="attachment wp-att-79" href="http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/smtpvalidateclassphp/">SMTP check code in PHP &#8211; DOWNLOAD</a></p>
<p>2) <a href="http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/checkemailexamplephp/">Usage example - DOWNLOAD</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>Does your website really need a CAPTCHA?</title>
		<link>http://www.webdigi.co.uk/blog/2009/does-your-website-really-need-a-captcha/</link>
		<comments>http://www.webdigi.co.uk/blog/2009/does-your-website-really-need-a-captcha/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 16:27:55 +0000</pubDate>
		<dc:creator>php-manual</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[forms]]></category>

		<guid isPermaLink="false">http://www.webdigi.co.uk/blog/?p=9</guid>
		<description><![CDATA[What is CAPTCHA?
CAPTCHA is an acronym for &#8220;completely automated public Turing test to tell computers and humans apart.&#8221; This can be with images / audio or whatever we will see in future.
Why do sites use it?
CAPTCHA is used to prevent bots from automatically submitting forms with SPAM or other unwanted content. Google and other companies [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;">What is CAPTCHA?</span></p>
<p>CAPTCHA is an acronym for &#8220;completely automated public Turing test to tell computers and humans apart.&#8221; This can be with images / audio or whatever we will see in future.</p>
<p><span style="text-decoration: underline;">Why do sites use it?</span></p>
<p>CAPTCHA is used to prevent bots from automatically submitting forms with SPAM or other unwanted content. Google and other companies use it to prevent bots from creating multiple Gmail accounts.</p>
<p><span style="text-decoration: underline;">What is wrong with it?</span></p>
<p>Users will have to enter this additional information every time they have to submit a form. This is getting more and more difficult to decode for humans as the bots are getting better at it. I am sure that everyone reading this post has atleast once got a CAPTCHA entered wrongly.</p>
<p><span style="text-decoration: underline;">Alternative Simple soultion</span>:</p>
<p>NOTE: Does not apply for highly targeted sites like gmail, yahoo mail and others alike.</p>
<p>However,<br />
If you have a sales form which requires an entry of username, email and phone number for a call back<br />
OR<br />
a simple contact us form with just name, number, description.</p>
<p>1) <span style="text-decoration: underline;">Have server validation of data.</span><br />
All the forms have only client validation in javascript. Just validate in server and you can have 70% of spam bot submissions caught.<br />
EG: If your form has Name, Email, Telephone.<br />
The bot will send some 500 character text in Name and valid email and some random data in phone field. A simple validation on the server to trash Name having more than 30 characters will do the trick.</p>
<p>2) <span style="text-decoration: underline;">Hidden input element</span><br />
Add an extra text input element to your form. In an external style sheet you set the element to display: none; thus making it invisible to all users with CSS enabled. Spam bots will usually fill all fields in a form you know that any forms submitted where this invisible field is not empty are spam.</p>
<p>With the above two simple steps you can see that most sites can avoid spam messages and still not having to use a captcha.</p>
<p>So in short &#8211; for all the websites with simple contact forms why do we use CAPTCHA and risk giving the customer an additional field to fill and risk not to getting them to fill it at all ??</p>
<p style="text-align: center;"><img class="size-full wp-image-14 aligncenter" title="Startrek data CAPTCHA" src="http://www.webdigi.co.uk/blog/wp-content/uploads/2009/01/datastartrek.jpg" alt="Startrek data CAPTCHA" width="480" height="343" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdigi.co.uk/blog/2009/does-your-website-really-need-a-captcha/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
