<?xml version="1.0" encoding="UTF-8"?>
<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>code-diesel &#187; email</title>
	<atom:link href="http://www.codediesel.com/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codediesel.com</link>
	<description>/* PHP &#38; MySQL Journal */</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:19:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Encode your email links to prevent spam</title>
		<link>http://www.codediesel.com/security/encode-your-email-links-to-prevent-spam/</link>
		<comments>http://www.codediesel.com/security/encode-your-email-links-to-prevent-spam/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 10:29:25 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=2771</guid>
		<description><![CDATA[One of the popular ways to hide your email on a web page from spam bots is to display the email as an image or to use the &#8216;[at]&#8216; word instead of the &#8216;@&#8217; sign. The code given here is yet another way to fight spam. The below function will let you to encode email [...]]]></description>
			<content:encoded><![CDATA[<p>One of the popular ways to hide your email on a web page from spam bots is to display the email as an image or to use the &#8216;[at]&#8216; word instead of the &#8216;@&#8217; sign. The code given here is yet another way to fight spam. The below function will let you to encode email or other links to their equivalent HTML entity encoded syntax. This will enable you to hide your web-page emails from spam bots. As the browser converts and displays the appropriate string from the encoding the user will be able to correctly see the email id, but a spam bot will have a difficult time to decode the encoded string. Of course we now have quite sophisticated crawlers that can work around this types of encoding, but for other crawlers that rely on regular expressions or other such simple methods, they will find it difficult to grab the email links from the page.<br />
<span id="more-2771"></span></p>
<h4>Encoding HTML characters</h4>
<p>The function is quite simple. It encodes email, links or other string characters to their &#8216;Numeric character references&#8217;. For example &#8216;<strong>code</strong>&#8216; will be encoded to <strong>&amp;#99;&amp;#111;&amp;#100;&amp;#101;</strong> &#8211; a decimal encoding or <strong>&amp;#X63;&amp;#X6f;&amp;#X64;&amp;#X65;</strong>  &#8211; a hexadecimal encoding.<br />
The function randomly encodes a character to a <em>hex</em> or <em>decimal</em> representation, so each page refresh will encode the same string to a different format.</p>

<div class="wp_codebox"><table><tr id="p27713"><td class="code" id="p2771code3"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> encodeString<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$enc_email</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">srand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;"># Convert each character to decimal or hex representation
</span>    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$enc_email</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&amp;#&quot;</span> <span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$enc_email</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&amp;#X&quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">dechex</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000088;">$enc_email</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">echo</span> encodeString<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;designhouse@host.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>This will convert the email &#8216;designhouse@host.com&#8217; to</p>

<div class="wp_codebox"><table><tr id="p27714"><td class="code" id="p2771code4"><pre class="text" style="font-family:monospace;">&amp;#100;&amp;#101;&amp;#X73;&amp;#X69;&amp;#X67;&amp;#X6e;&amp;#104;
&amp;#X6f;&amp;#X75;&amp;#115;&amp;#101;&amp;#64;&amp;#X68;&amp;#111;
&amp;#X73;&amp;#116;&amp;#X2e;&amp;#99;&amp;#111;&amp;#109;</pre></td></tr></table></div>

<p>As it uses a random base (decimal or hex), the actual results may differ from yours.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/security/encode-your-email-links-to-prevent-spam/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Attractive HTML Email templates</title>
		<link>http://www.codediesel.com/design/attractive-html-email-templates/</link>
		<comments>http://www.codediesel.com/design/attractive-html-email-templates/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 05:12:10 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=2767</guid>
		<description><![CDATA[Although my primary interests lie in software development, good design is something I cannot ignore. I quite often need to send HTML emails to clients but have to settle for simple designs due to lack of good templates; and getting someone else to design it ends up taking a lot of time with unsatisfactory results. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codediesel.com/wp-content/uploads/2010/12/email-templates.gif"><img src="http://www.codediesel.com/wp-content/uploads/2010/12/email-templates.gif" alt="" title="email-templates" width="190" height="150" class="alignleft size-full wp-image-2768" /></a>Although my primary interests lie in software development, good design is something I cannot ignore. I quite often need to send HTML emails to clients but have to settle for simple designs due to lack of good templates; and getting someone else to design it ends up taking a lot of time with unsatisfactory results.<br />
<span id="more-2767"></span><br />
<a target="_blank" href="http://www.campaignmonitor.com/templates/">Campaignmonitor</a> provides a showcase of 30+ free email templates for download, ready with PSD files. Each template comes tested with various email programs, including iPhone, although I&#8217;ve only used it with Gmail. Various designers around the world have contributed their designs to the template bouquet. If you use <a target="_blank" href="http://www.campaignmonitor.com/">campaignmonitor</a> the templates also includes HTML files with the appropriate tags for working with the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/design/attractive-html-email-templates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Local email testing of applications</title>
		<link>http://www.codediesel.com/tools/local-email-testing-of-applications/</link>
		<comments>http://www.codediesel.com/tools/local-email-testing-of-applications/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 04:41:25 +0000</pubDate>
		<dc:creator>sameer</dc:creator>
				<category><![CDATA[tools]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://www.codediesel.com/?p=1697</guid>
		<description><![CDATA[local testing of email applications]]></description>
			<content:encoded><![CDATA[<p>E-mails are a pervasive element of most web applications. But many times testing and debugging emails can become a hassle when many of them are involved. Most of the time you just want to be sure that the email part of your application is working fine, without flooding your mail account with test mails.<br />
<span id="more-1697"></span><br />
<a target="_blank" href="http://invalidlogic.com/papercut/">Papercut</a> is a simplified SMTP server designed to help you receive emails from your local applications but without sending them out. It doesn&#8217;t even care if the email address you sent is valid or not. It just takes the email you sent and displays and logs it in a window for you to see if it is correct. It can be quite useful if you just need to make sure that the email part of your applications is working fine.</p>
<h4>Installation</h4>
<p>Papercut is a Windows application requiring .NET Framework 3.5 . Thankfully no installation is required as the application can be run directly. Upon activation it sits in the system tray and pops a message when a email is received from a local web application.</p>
<p><a href="http://www.codediesel.com/wp-content/uploads/2009/10/papercut1.png"><img style="border:1px solid #000;" src="http://www.codediesel.com/wp-content/uploads/2009/10/papercut1.png" alt="papercut1" title="papercut1" width="238" height="62" class="aligncenter size-full wp-image-1701" /></a></p>
<p>The messages can then be viewed in the Papercut window.</p>
<p><a href="http://www.codediesel.com/wp-content/uploads/2009/10/papercut2.png"><img src="http://www.codediesel.com/wp-content/uploads/2009/10/papercut2.png" alt="papercut2" title="papercut2" width="490" height="282" class="aligncenter size-full wp-image-1705" /></a></p>
<p>In all a simple and useful tool for any web developer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codediesel.com/tools/local-email-testing-of-applications/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

