<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/3.3.1" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>WorxWare</title>
		<link>http://blog.worxware.com/blog1.php</link>
		<atom:link rel="self" type="application/rss+xml" href="http://blog.worxware.com/blog1.php?tempskin=_rss2" />
		<description></description>
		<language>en-US</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=3.3.1"/>
		<ttl>60</ttl>
				<item>
			<title>Welcome to my blog!</title>
			<link>http://blog.worxware.com/blog1.php/2009/08/21/welcome-to-my-blod</link>
			<pubDate>Fri, 21 Aug 2009 07:28:27 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="main">Welcome</category>			<guid isPermaLink="false">30@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;Through this blog, I will be posting articles on technology, mainly related to email processing.&lt;/p&gt;
&lt;p&gt;Please keep your replies related to the topic. This blog will not be used to provide any support or individual tutorials.&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2009/08/21/welcome-to-my-blod&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Through this blog, I will be posting articles on technology, mainly related to email processing.</p>
<p>Please keep your replies related to the topic. This blog will not be used to provide any support or individual tutorials.</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2009/08/21/welcome-to-my-blod">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2009/08/21/welcome-to-my-blod#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=30</wfw:commentRss>
		</item>
				<item>
			<title>About Forms, data validation</title>
			<link>http://blog.worxware.com/blog1.php/2010/12/27/about-forms-data-validation</link>
			<pubDate>Mon, 27 Dec 2010 17:20:31 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="main">Welcome</category>			<guid isPermaLink="false">47@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;About five years ago, one of our clients contacted us about a project to minimize spam generated from their Feedback and Contact Us forms on their site. Not only were they getting more than 500 spam emails daily from the forms, but the forms were also being used to relay spam to large mailing lists showing the client as the sender.&lt;/p&gt;
&lt;p&gt;This wasn't the first time we had been contracted to solve this type of problem.&lt;/p&gt;
&lt;p&gt;It is rare to see a website without a form. Forms are the life-blood between your presence on the web and the prospects and clients that you want to interact with. Forms provide you with the data that makes or breaks your business. Forms can be used to collect user information. Examples are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Contact Us&lt;/li&gt;
&lt;li&gt;Feedback system&lt;/li&gt;
&lt;li&gt;Surveys&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Forms can also be used to populate your databases. Examples are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Registration/Sign-up&lt;/li&gt;
&lt;li&gt;Data input of all types&lt;/li&gt;
&lt;li&gt;E-commerce&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the first set, collecting user information, the data collected is typically sent by email to the designated recipient, usually you or someone you appoint to get these types of info. emails. The forms require security to prevent hi-jacking of your form to deliver the hacker's email payload using your bandwidth and your identity.&lt;/p&gt;
&lt;p&gt;In the second set, populating your database, the data collected is typically posted directly to the database. You may have a verification process where new accounts need to be approved before being live, but essentially the process is to take the user data typed in the form and post it directly to a database. These forms are particularly dangerous because a hacker can use the form to gain access to your entire database.&lt;/p&gt;
&lt;p&gt;Back to the five year old project ... using a variety of techniques, we were able to eliminate almost 100% of all the hacks and spam emails. This hasn't been easy and we've changed strategies over time.&lt;/p&gt;
&lt;p&gt;Our initial efforts were based on Javascript to both validate and format the data. That eliminated about 50% of all the emails. In analyzing why the Javascript was only 50% effective, we found that most hackers were already familiar with client-side validation. Using browser techniques, they launched the form, and then disabled Javascript to bypass the validation.&lt;/p&gt;
&lt;p&gt;We then combined the Javascript validation (client-side validation) with server-side validation. Over a period of about 8 months refinining this technique, we were able to nearly eliminate 100% of the garbage emails.&lt;/p&gt;
&lt;p&gt;That was four years ago. Since then we have changed our server-side validation several times using third-party scripts with some modifications from us. That was our proof of concept -- server-side validation works. To date, no one has been able to get past the server-side validation.&lt;/p&gt;
&lt;p&gt;The first server-side validation script we used was the proof we needed that this technology is a must-have. Only one problem, though, is that third-party scripts typically are designed around the author's needs and not very flexible. Such was the case with the first server-side script we used. The validation rules were all based on some very rigid needs of the author, plus was tied to a templating system that forced a very rigid style of form design. For example, the templating system isn't able to handle multi-column forms, or radio buttons / check boxes horizontally. Plus, validation error messages were rigid in how they displayed.&lt;/p&gt;
&lt;p&gt;Our second choice for server-side validation was newer technology and based on a more flexible templating system. It was closer to our needs -- but it lacked in validation rules and validation error messages were cryptic.&lt;/p&gt;
&lt;p&gt;We have now totally eliminated client-side validation. The hacker's work-arounds for javascript based validation are too well known and client-side validation is now far far less effective rendering client-side validation as close to useless as possible.&lt;/p&gt;
&lt;p&gt;We are also working on our our PHP-based server-side validation scripts that we expect to release as Open Source in 2011. If you have any feedback or features you would like to see, drop us a line.&lt;/p&gt;
&lt;p&gt;Andy&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2010/12/27/about-forms-data-validation&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>About five years ago, one of our clients contacted us about a project to minimize spam generated from their Feedback and Contact Us forms on their site. Not only were they getting more than 500 spam emails daily from the forms, but the forms were also being used to relay spam to large mailing lists showing the client as the sender.</p>
<p>This wasn't the first time we had been contracted to solve this type of problem.</p>
<p>It is rare to see a website without a form. Forms are the life-blood between your presence on the web and the prospects and clients that you want to interact with. Forms provide you with the data that makes or breaks your business. Forms can be used to collect user information. Examples are:</p>
<ul>
<li>Contact Us</li>
<li>Feedback system</li>
<li>Surveys</li>
</ul>
<p>Forms can also be used to populate your databases. Examples are:</p>
<ul>
<li>Registration/Sign-up</li>
<li>Data input of all types</li>
<li>E-commerce</li>
</ul>
<p>In the first set, collecting user information, the data collected is typically sent by email to the designated recipient, usually you or someone you appoint to get these types of info. emails. The forms require security to prevent hi-jacking of your form to deliver the hacker's email payload using your bandwidth and your identity.</p>
<p>In the second set, populating your database, the data collected is typically posted directly to the database. You may have a verification process where new accounts need to be approved before being live, but essentially the process is to take the user data typed in the form and post it directly to a database. These forms are particularly dangerous because a hacker can use the form to gain access to your entire database.</p>
<p>Back to the five year old project ... using a variety of techniques, we were able to eliminate almost 100% of all the hacks and spam emails. This hasn't been easy and we've changed strategies over time.</p>
<p>Our initial efforts were based on Javascript to both validate and format the data. That eliminated about 50% of all the emails. In analyzing why the Javascript was only 50% effective, we found that most hackers were already familiar with client-side validation. Using browser techniques, they launched the form, and then disabled Javascript to bypass the validation.</p>
<p>We then combined the Javascript validation (client-side validation) with server-side validation. Over a period of about 8 months refinining this technique, we were able to nearly eliminate 100% of the garbage emails.</p>
<p>That was four years ago. Since then we have changed our server-side validation several times using third-party scripts with some modifications from us. That was our proof of concept -- server-side validation works. To date, no one has been able to get past the server-side validation.</p>
<p>The first server-side validation script we used was the proof we needed that this technology is a must-have. Only one problem, though, is that third-party scripts typically are designed around the author's needs and not very flexible. Such was the case with the first server-side script we used. The validation rules were all based on some very rigid needs of the author, plus was tied to a templating system that forced a very rigid style of form design. For example, the templating system isn't able to handle multi-column forms, or radio buttons / check boxes horizontally. Plus, validation error messages were rigid in how they displayed.</p>
<p>Our second choice for server-side validation was newer technology and based on a more flexible templating system. It was closer to our needs -- but it lacked in validation rules and validation error messages were cryptic.</p>
<p>We have now totally eliminated client-side validation. The hacker's work-arounds for javascript based validation are too well known and client-side validation is now far far less effective rendering client-side validation as close to useless as possible.</p>
<p>We are also working on our our PHP-based server-side validation scripts that we expect to release as Open Source in 2011. If you have any feedback or features you would like to see, drop us a line.</p>
<p>Andy</p>
<p>&#160;</p>
<p>&#160;</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2010/12/27/about-forms-data-validation">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2010/12/27/about-forms-data-validation#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=47</wfw:commentRss>
		</item>
				<item>
			<title>Hotmail Server Changes</title>
			<link>http://blog.worxware.com/blog1.php/2010/05/31/hotmail-server-changes</link>
			<pubDate>Mon, 31 May 2010 21:22:03 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="main">Mail Servers</category>			<guid isPermaLink="false">46@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;Microsoft has recently made changes to their Hotmail ports and settings.&lt;/p&gt;
&lt;p&gt;Our basic example on the PHPMailer website now is:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-family: courier new,courier;&quot;&gt;require_once('../class.phpmailer.php');&lt;br /&gt;//include(&quot;class.smtp.php&quot;); // optional, gets called from within class.phpmailer.php if not already loaded&lt;br /&gt;&lt;br /&gt;$mail             = new PHPMailer();&lt;br /&gt;&lt;br /&gt;$body             = file_get_contents('contents.html');&lt;br /&gt;$body             = eregi_replace(&quot;[\]&quot;,'',$body);&lt;br /&gt;&lt;br /&gt;$mail-&amp;gt;IsSMTP(); // telling the class to use SMTP&lt;br /&gt;$mail-&amp;gt;Host       = &quot;mail.yourdomain.com&quot;; // SMTP server&lt;br /&gt;$mail-&amp;gt;SMTPDebug  = 2;                     // enables SMTP debug information (for testing)&lt;br /&gt; // 1 = errors and messages&lt;br /&gt; // 2 = messages only&lt;br /&gt;$mail-&amp;gt;SMTPAuth   = true;                  // enable SMTP authentication&lt;br /&gt;$mail-&amp;gt;SMTPSecure = &quot;tls&quot;;                 // sets the prefix to the servier&lt;br /&gt;$mail-&amp;gt;Host       = &quot;smtp.live.com&quot;;      // sets HOTMAIL as the SMTP server&lt;br /&gt;$mail-&amp;gt;Port       = 25;                   // alternate is &quot;26&quot; - set the SMTP port for the HOTMAIL server&lt;br /&gt;$mail-&amp;gt;Username   = &quot;yourusername@hotmail.com&quot;;  // HOTMAIL username&lt;br /&gt;$mail-&amp;gt;Password   = &quot;yourpassword&quot;;            // HOTMAIL password&lt;br /&gt;&lt;br /&gt;$mail-&amp;gt;SetFrom('name@yourdomain.com', 'First Last');&lt;br /&gt;&lt;br /&gt;$mail-&amp;gt;AddReplyTo(&quot;name@yourdomain.com&quot;,&quot;First Last&quot;);&lt;br /&gt;&lt;br /&gt;$mail-&amp;gt;Subject    = &quot;PHPMailer Test Subject via smtp (Hotmail), basic&quot;;&lt;br /&gt;&lt;br /&gt;$mail-&amp;gt;AltBody    = &quot;To view the message, please use an HTML compatible email viewer!&quot;; // optional, comment out and test&lt;br /&gt;&lt;br /&gt;$mail-&amp;gt;MsgHTML($body);&lt;br /&gt;&lt;br /&gt;$address = &quot;whoto@otherdomain.com&quot;;&lt;br /&gt;$mail-&amp;gt;AddAddress($address, &quot;John Doe&quot;);&lt;br /&gt;&lt;br /&gt;$mail-&amp;gt;AddAttachment(&quot;images/phpmailer.gif&quot;);      // attachment&lt;br /&gt;$mail-&amp;gt;AddAttachment(&quot;images/phpmailer_mini.gif&quot;); // attachment&lt;br /&gt;&lt;br /&gt;if(!$mail-&amp;gt;Send()) {&lt;br /&gt; echo &quot;Mailer Error: &quot; . $mail-&amp;gt;ErrorInfo;&lt;br /&gt;} else {&lt;br /&gt; echo &quot;Message sent!&quot;;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Andy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2010/05/31/hotmail-server-changes&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>Microsoft has recently made changes to their Hotmail ports and settings.</p>
<p>Our basic example on the PHPMailer website now is:</p>
<p><span style="font-family: courier new,courier;">require_once('../class.phpmailer.php');<br />//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded<br /><br />$mail             = new PHPMailer();<br /><br />$body             = file_get_contents('contents.html');<br />$body             = eregi_replace("[\]",'',$body);<br /><br />$mail-&gt;IsSMTP(); // telling the class to use SMTP<br />$mail-&gt;Host       = "mail.yourdomain.com"; // SMTP server<br />$mail-&gt;SMTPDebug  = 2;                     // enables SMTP debug information (for testing)<br /> // 1 = errors and messages<br /> // 2 = messages only<br />$mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication<br />$mail-&gt;SMTPSecure = "tls";                 // sets the prefix to the servier<br />$mail-&gt;Host       = "smtp.live.com";      // sets HOTMAIL as the SMTP server<br />$mail-&gt;Port       = 25;                   // alternate is "26" - set the SMTP port for the HOTMAIL server<br />$mail-&gt;Username   = "yourusername@hotmail.com";  // HOTMAIL username<br />$mail-&gt;Password   = "yourpassword";            // HOTMAIL password<br /><br />$mail-&gt;SetFrom('name@yourdomain.com', 'First Last');<br /><br />$mail-&gt;AddReplyTo("name@yourdomain.com","First Last");<br /><br />$mail-&gt;Subject    = "PHPMailer Test Subject via smtp (Hotmail), basic";<br /><br />$mail-&gt;AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test<br /><br />$mail-&gt;MsgHTML($body);<br /><br />$address = "whoto@otherdomain.com";<br />$mail-&gt;AddAddress($address, "John Doe");<br /><br />$mail-&gt;AddAttachment("images/phpmailer.gif");      // attachment<br />$mail-&gt;AddAttachment("images/phpmailer_mini.gif"); // attachment<br /><br />if(!$mail-&gt;Send()) {<br /> echo "Mailer Error: " . $mail-&gt;ErrorInfo;<br />} else {<br /> echo "Message sent!";<br />}</span></p>
<p>Andy</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2010/05/31/hotmail-server-changes">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2010/05/31/hotmail-server-changes#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=46</wfw:commentRss>
		</item>
				<item>
			<title>Stripping HTML code for AltBody and PHPMailer-FE</title>
			<link>http://blog.worxware.com/blog1.php/2010/05/31/stripping-html-code-for-altbody-and-phpmailer-fe</link>
			<pubDate>Mon, 31 May 2010 21:11:09 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="alt">Welcome</category>
<category domain="main">Extending PHPMailer</category>			<guid isPermaLink="false">45@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;As the developers, we obviously use PHPMailer extensively in our applications. In some, we were using HTML2Text, a very good utility available at chuggnut.com. For basic forms processing, HTML2Text is overkill and does not render the forms data properly -- particularly the tables, th, td, and tr tags.&lt;/p&gt;
&lt;p&gt;We modified several functions that we use in our content management systems and in our own PHPMailer scripts and wish to discuss those here and provide them for your use: same license as PHPMailer, LGPL -- please attribute properly.&lt;/p&gt;
&lt;p&gt;The two functions that we modified are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A function that strips out the &amp;lt;body&amp;gt; tag through to the &amp;lt;/body&amp;gt; tag, inclusive. We use this in a commercial email marketing application to strip out all the HTML tags above and including &amp;lt;body ... &amp;gt; and strip out all the HTML tags below and including &amp;lt;/body&amp;gt; (meaning exclusive of the body tags) ... the modifications are to inverse the results returning only the inclusive portion.&lt;/li&gt;
&lt;li&gt;A function that:                   
&lt;ul&gt;
&lt;li&gt;converts HTML entities to character representations&lt;/li&gt;
&lt;li&gt;strips out all new line characters and spaces after the closing tag element&lt;/li&gt;
&lt;li&gt;converts &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; to new line characters&lt;/li&gt;
&lt;li&gt;converts &amp;lt;/td&amp;gt; to a colon and space&lt;/li&gt;
&lt;li&gt;then strips all tags&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first function is to strip out certain code that is not processed by other HTML to Text conversion utilities. One example, is the &amp;lt;style&amp;gt;&amp;lt;/style&amp;gt; tags and everything contained within those two tags.&lt;/p&gt;
&lt;p&gt;&lt;code&gt; function _stripStartEndStr($str,$startTag='&amp;lt;style&amp;gt;',$endTag='&amp;lt;/style&amp;gt;') {&lt;br /&gt; /* Copyright Andy Prevost */&lt;br /&gt; $startTag       = strtolower($startTag);&lt;br /&gt; $endTag         = strtolower($endTag);&lt;br /&gt; $lower_contents = strtolower($str);&lt;br /&gt; // determine if a $startTag tag exists and process if necessary&lt;br /&gt; do {     $posStart = strpos($lower_contents,$startTag);&lt;br /&gt; if ( $posStart !== false ) {&lt;br /&gt; $posEndStart = strpos($lower_contents, $endTag);&lt;br /&gt; $posEnd      = $posEndStart + strlen($endTag) + 1;&lt;br /&gt; $posEnd      = $posEnd - $posStart;&lt;br /&gt; // return stripped out tags and contents&lt;br /&gt; $strPart = substr($str, $posStart, $posEnd);&lt;br /&gt; $str     = str_replace($strPart,'',$str);&lt;br /&gt; }&lt;br /&gt; } while (0);&lt;br /&gt; return $str;&lt;br /&gt; } &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To use this function, derive your HTML the normal way, then convert it to text:&lt;/p&gt;
&lt;p&gt;$html = {whatever  you normally do};&lt;/p&gt;
&lt;p&gt;$text = _stripStartEndStr($html);&lt;/p&gt;
&lt;p&gt;The next function does the actual HTML to Text conversion. Note that it will render your tables reasonably, convert all HTML entities to characters (like &amp;amp;copy; to &amp;#169;)&lt;/p&gt;
&lt;p&gt;function _html2txt($html) {&lt;br /&gt; /* Copyright Andy Prevost */&lt;br /&gt; if (trim($html)=='') { return $html; }&lt;br /&gt; $text = htmlspecialchars_decode($html);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/table&amp;gt;&quot;, &quot;&amp;lt;/TABLE&amp;gt;&quot;, $text);&lt;br /&gt; do { if (strpos($text,&quot; &amp;lt;/TABLE&amp;gt;&quot;)) { $text = str_replace(&quot; &amp;lt;/TABLE&amp;gt;&quot;, &quot;&amp;lt;/TABLE&amp;gt;&quot;, $text); } else { break; } } while (0);&lt;br /&gt; do { if (strpos($text,&quot;&amp;gt;\n\n&quot;)) { $text = str_replace(&quot;&amp;gt;\n\n&quot;, &quot;&amp;gt;\n&quot;, $text); } else { break; } } while (0);&lt;br /&gt; $text = str_replace(&quot;&amp;gt;\n&quot;, &quot;&amp;gt;&quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/tr&amp;gt;&quot;, &quot;&amp;lt;/TR&amp;gt;&quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/td&amp;gt;&quot;, &quot;&amp;lt;/TD&amp;gt;&quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/th&amp;gt;&quot;, &quot;&amp;lt;/TH&amp;gt;&quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&quot;, &quot;\n&quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/TH&amp;gt;&amp;lt;/TR&amp;gt;&quot;, &quot;\n&quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/TD&amp;gt;&quot;, &quot;: &quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/TH&amp;gt;&quot;, &quot;: &quot;, $text);&lt;br /&gt; $text = str_replace(&quot;&amp;lt;/TR&amp;gt;&quot;, &quot;\n&quot;, $text);&lt;br /&gt; $text = strip_tags($text);&lt;br /&gt; return $text;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;... then add your HTML content, and add your Text content&lt;/p&gt;
&lt;p&gt;$mail-&amp;gt;MsgHTML($html);&lt;/p&gt;
&lt;p&gt;$mail-&amp;gt;AltBody  = _html2txt($text);&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;br /&gt;Andy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2010/05/31/stripping-html-code-for-altbody-and-phpmailer-fe&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>As the developers, we obviously use PHPMailer extensively in our applications. In some, we were using HTML2Text, a very good utility available at chuggnut.com. For basic forms processing, HTML2Text is overkill and does not render the forms data properly -- particularly the tables, th, td, and tr tags.</p>
<p>We modified several functions that we use in our content management systems and in our own PHPMailer scripts and wish to discuss those here and provide them for your use: same license as PHPMailer, LGPL -- please attribute properly.</p>
<p>The two functions that we modified are:</p>
<ol>
<li>A function that strips out the &lt;body&gt; tag through to the &lt;/body&gt; tag, inclusive. We use this in a commercial email marketing application to strip out all the HTML tags above and including &lt;body ... &gt; and strip out all the HTML tags below and including &lt;/body&gt; (meaning exclusive of the body tags) ... the modifications are to inverse the results returning only the inclusive portion.</li>
<li>A function that:                   
<ul>
<li>converts HTML entities to character representations</li>
<li>strips out all new line characters and spaces after the closing tag element</li>
<li>converts &lt;/td&gt;&lt;/tr&gt; to new line characters</li>
<li>converts &lt;/td&gt; to a colon and space</li>
<li>then strips all tags</li>
</ul>
</li>
</ol>
<p>The first function is to strip out certain code that is not processed by other HTML to Text conversion utilities. One example, is the &lt;style&gt;&lt;/style&gt; tags and everything contained within those two tags.</p>
<p><code> function _stripStartEndStr($str,$startTag='&lt;style&gt;',$endTag='&lt;/style&gt;') {<br /> /* Copyright Andy Prevost */<br /> $startTag       = strtolower($startTag);<br /> $endTag         = strtolower($endTag);<br /> $lower_contents = strtolower($str);<br /> // determine if a $startTag tag exists and process if necessary<br /> do {     $posStart = strpos($lower_contents,$startTag);<br /> if ( $posStart !== false ) {<br /> $posEndStart = strpos($lower_contents, $endTag);<br /> $posEnd      = $posEndStart + strlen($endTag) + 1;<br /> $posEnd      = $posEnd - $posStart;<br /> // return stripped out tags and contents<br /> $strPart = substr($str, $posStart, $posEnd);<br /> $str     = str_replace($strPart,'',$str);<br /> }<br /> } while (0);<br /> return $str;<br /> } </code></p>
<p>To use this function, derive your HTML the normal way, then convert it to text:</p>
<p>$html = {whatever  you normally do};</p>
<p>$text = _stripStartEndStr($html);</p>
<p>The next function does the actual HTML to Text conversion. Note that it will render your tables reasonably, convert all HTML entities to characters (like &amp;copy; to &#169;)</p>
<p>function _html2txt($html) {<br /> /* Copyright Andy Prevost */<br /> if (trim($html)=='') { return $html; }<br /> $text = htmlspecialchars_decode($html);<br /> $text = str_replace("&lt;/table&gt;", "&lt;/TABLE&gt;", $text);<br /> do { if (strpos($text," &lt;/TABLE&gt;")) { $text = str_replace(" &lt;/TABLE&gt;", "&lt;/TABLE&gt;", $text); } else { break; } } while (0);<br /> do { if (strpos($text,"&gt;\n\n")) { $text = str_replace("&gt;\n\n", "&gt;\n", $text); } else { break; } } while (0);<br /> $text = str_replace("&gt;\n", "&gt;", $text);<br /> $text = str_replace("&lt;/tr&gt;", "&lt;/TR&gt;", $text);<br /> $text = str_replace("&lt;/td&gt;", "&lt;/TD&gt;", $text);<br /> $text = str_replace("&lt;/th&gt;", "&lt;/TH&gt;", $text);<br /> $text = str_replace("&lt;/TD&gt;&lt;/TR&gt;", "\n", $text);<br /> $text = str_replace("&lt;/TH&gt;&lt;/TR&gt;", "\n", $text);<br /> $text = str_replace("&lt;/TD&gt;", ": ", $text);<br /> $text = str_replace("&lt;/TH&gt;", ": ", $text);<br /> $text = str_replace("&lt;/TR&gt;", "\n", $text);<br /> $text = strip_tags($text);<br /> return $text;<br /> }</p>
<p>... then add your HTML content, and add your Text content</p>
<p>$mail-&gt;MsgHTML($html);</p>
<p>$mail-&gt;AltBody  = _html2txt($text);</p>
<p>Enjoy!<br />Andy</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2010/05/31/stripping-html-code-for-altbody-and-phpmailer-fe">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2010/05/31/stripping-html-code-for-altbody-and-phpmailer-fe#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=45</wfw:commentRss>
		</item>
				<item>
			<title>New Documentation Site coming!</title>
			<link>http://blog.worxware.com/blog1.php/2009/11/26/new-documentation-site-coming</link>
			<pubDate>Thu, 26 Nov 2009 06:26:41 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="main">Welcome</category>			<guid isPermaLink="false">42@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;We are working on new documentation for all of our software. The documentation will include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Requirements&lt;/li&gt;
&lt;li&gt;Pre-installation instructions&lt;/li&gt;
&lt;li&gt;Installation instructions&lt;/li&gt;
&lt;li&gt;Accessing the installed software&lt;/li&gt;
&lt;li&gt;Basic usage and tutorials&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first set of documentation is nearly complete for our upcoming release of PHPMailer-ML version 1.8.&lt;/p&gt;
&lt;p&gt;The documentation is being setup as a &quot;knowledgebase&quot; and you can preview it at:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.worxware.com/kb/&quot;&gt;&lt;a href=&quot;http://www.worxware.com/kb/&quot;&gt;http://www.worxware.com/kb/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[update: feb 04 2010]&lt;/strong&gt; The documentation site software is not flexible enough to provide an organized view of the documentation the way we want it. We are working on another software platform at:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.worxware.com/kb/&quot;&gt;&lt;a href=&quot;http://www.worxware.com/kbn/&quot;&gt;http://www.worxware.com/kbn/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;br /&gt;Andy&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2009/11/26/new-documentation-site-coming&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>We are working on new documentation for all of our software. The documentation will include:</p>
<ul>
<li>Requirements</li>
<li>Pre-installation instructions</li>
<li>Installation instructions</li>
<li>Accessing the installed software</li>
<li>Basic usage and tutorials</li>
</ul>
<p>The first set of documentation is nearly complete for our upcoming release of PHPMailer-ML version 1.8.</p>
<p>The documentation is being setup as a "knowledgebase" and you can preview it at:</p>
<p><a href="http://www.worxware.com/kb/"><a href="http://www.worxware.com/kb/">http://www.worxware.com/kb/</a></a></p>
<p><strong>[update: feb 04 2010]</strong> The documentation site software is not flexible enough to provide an organized view of the documentation the way we want it. We are working on another software platform at:</p>
<p><a href="http://www.worxware.com/kb/"><a href="http://www.worxware.com/kbn/">http://www.worxware.com/kbn/</a></a></p>
<p>Enjoy!<br />Andy</p>
<p>&#160;</p>
<p>&#160;</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2009/11/26/new-documentation-site-coming">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2009/11/26/new-documentation-site-coming#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=42</wfw:commentRss>
		</item>
				<item>
			<title>Significant new enhancements for PHPMailer-ML</title>
			<link>http://blog.worxware.com/blog1.php/2009/11/01/significant-new-enhancements-for-phpmailer-ml</link>
			<pubDate>Mon, 02 Nov 2009 01:43:48 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="main">Welcome</category>			<guid isPermaLink="false">41@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;PHPMailer-ML v1.8 will include some significant new features including an enhanced user interface, plus:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Accordion for left column and right column of page design&lt;/li&gt;
&lt;li&gt;More help for Campaigns page&lt;/li&gt;
&lt;li&gt;Tooltips to display more Subscriber information &lt;/li&gt;
&lt;li&gt;Username/Password editor for .HTPASSWD file -- allows for multiple users (with only one full admin)&lt;/li&gt;
&lt;li&gt;Integrated QuickCSV&lt;/li&gt;
&lt;li&gt;New &quot;modules&quot; structure for future expansion of features&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ability to track the opening of emails&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;with basic statistics page showing who/when email was opened&lt;br /&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;... and lots more&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It's clear that PHPMailer-ML is in the mainstream of Mailing List managers and Email campaign management. PHPMailer-ML is approaching 50,000 users and with the upcoming new features, PHPMailer-ML is expected to become the most popular mailing list software available.&lt;/p&gt;
&lt;p&gt;Andy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2009/11/01/significant-new-enhancements-for-phpmailer-ml&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>PHPMailer-ML v1.8 will include some significant new features including an enhanced user interface, plus:</p>
<ul>
<li>Accordion for left column and right column of page design</li>
<li>More help for Campaigns page</li>
<li>Tooltips to display more Subscriber information </li>
<li>Username/Password editor for .HTPASSWD file -- allows for multiple users (with only one full admin)</li>
<li>Integrated QuickCSV</li>
<li>New "modules" structure for future expansion of features</li>
<li><strong>Ability to track the opening of emails</strong></li>
<li><strong>with basic statistics page showing who/when email was opened<br /></strong></li>
<li>... and lots more<strong><br /></strong></li>
</ul>
<p>It's clear that PHPMailer-ML is in the mainstream of Mailing List managers and Email campaign management. PHPMailer-ML is approaching 50,000 users and with the upcoming new features, PHPMailer-ML is expected to become the most popular mailing list software available.</p>
<p>Andy</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2009/11/01/significant-new-enhancements-for-phpmailer-ml">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2009/11/01/significant-new-enhancements-for-phpmailer-ml#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=41</wfw:commentRss>
		</item>
				<item>
			<title>Create DKIM public/private keys</title>
			<link>http://blog.worxware.com/blog1.php/2009/09/17/create-dkim-public-private-keys</link>
			<pubDate>Fri, 18 Sep 2009 02:59:34 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="main">Email Related</category>			<guid isPermaLink="false">40@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;We had originally planned to release a utility &quot;create_dkim_keys.php&quot; with the upcoming new version of PHPMailer (v5.1) and the new PHPMailer Lite.&lt;/p&gt;
&lt;p&gt;We have had a change in this plan.&lt;/p&gt;
&lt;p&gt;We will be offering a utility to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create DKIM private key&lt;/li&gt;
&lt;li&gt;create DKIM public key&lt;/li&gt;
&lt;li&gt;create DomainKey DNS resource record with instructions&lt;/li&gt;
&lt;li&gt;create PHPMailer code to DKIM digitally sign emails&lt;/li&gt;
&lt;li&gt;put all four files in a ZIP and give you the ability to download&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The utility is up and running now at &lt;a href=&quot;http://dkim.worxware.com/&quot;&gt;http://dkim.worxware.com/&lt;/a&gt; ... have a read through the introduction information. Some very valuable information there.&lt;/p&gt;
&lt;p&gt;Keep in mind this is a release candidate -- use judgement before implementing in a production environment.&lt;/p&gt;
&lt;p&gt;Andy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2009/09/17/create-dkim-public-private-keys&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>We had originally planned to release a utility "create_dkim_keys.php" with the upcoming new version of PHPMailer (v5.1) and the new PHPMailer Lite.</p>
<p>We have had a change in this plan.</p>
<p>We will be offering a utility to:</p>
<ul>
<li>create DKIM private key</li>
<li>create DKIM public key</li>
<li>create DomainKey DNS resource record with instructions</li>
<li>create PHPMailer code to DKIM digitally sign emails</li>
<li>put all four files in a ZIP and give you the ability to download</li>
</ul>
<p>The utility is up and running now at <a href="http://dkim.worxware.com/">http://dkim.worxware.com/</a> ... have a read through the introduction information. Some very valuable information there.</p>
<p>Keep in mind this is a release candidate -- use judgement before implementing in a production environment.</p>
<p>Andy</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2009/09/17/create-dkim-public-private-keys">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2009/09/17/create-dkim-public-private-keys#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=40</wfw:commentRss>
		</item>
				<item>
			<title>DKIM and Callback function for PHPMailer</title>
			<link>http://blog.worxware.com/blog1.php/2009/09/15/dkim-and-callback-function-for-phpmailer</link>
			<pubDate>Tue, 15 Sep 2009 17:11:41 +0000</pubDate>			<dc:creator>Andy Prevost</dc:creator>
			<category domain="main">Email Related</category>			<guid isPermaLink="false">39@http://blog.worxware.com/</guid>
						<description>&lt;p&gt;We are working on a major release of PHPMailer, and a new PHPMailer Lite. Two major new features are coming.&lt;/p&gt;
&lt;p&gt;DKIM (DomainKeys Identified Mail) is now an adopted standard for Yahoo, Gmail, and AOL. To understand the impact of DKIM on getting into the inbox of your Yahoo, Gmail, AOL and other users, read through the &lt;a href=&quot;http://www.dkim.org/&quot;&gt;DKIM FAQ&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Along with PHPMailer (and PHPMailer Lite) we will be providing a utility to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create DKIM Private key&lt;/li&gt;
&lt;li&gt;create DKIM Public key&lt;/li&gt;
&lt;li&gt;create DNS Resource Record entry&lt;/li&gt;
&lt;li&gt;create PHPMailer resource code for your scripts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &quot;Create DKIM Keys&quot; utility will include a form to fill in your domain, email identity, DNS resource record selector, and passphrase for the DKIM keys.&lt;/p&gt;
&lt;p&gt;The second major feature of PHPMailer is support for callback function. The results of each email send transaction will be passed to a callback function that you control entirely. The parameters passed include success flag, recipient, cc, bcc, subject, and email body. Based on receiving these parameters in your callback function, you can easily pass the results as an echo back to the screen, build CSV logs, update database records, etc. The possibilities are endless and provide you total control. Example callback functions will be included in the release. Think of it -- immediate feedback on sending status, plus all the information to update your databases.&lt;/p&gt;
&lt;p&gt;Release date is fairly soon, anyone wanting to beta test prior to launch (with commitments to feedback in a timely manner) can contact me.&lt;/p&gt;
&lt;p&gt;Andy&lt;/p&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blog.worxware.com/blog1.php/2009/09/15/dkim-and-callback-function-for-phpmailer&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://b2evolution.net/&quot;&gt;b2evolution&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[<p>We are working on a major release of PHPMailer, and a new PHPMailer Lite. Two major new features are coming.</p>
<p>DKIM (DomainKeys Identified Mail) is now an adopted standard for Yahoo, Gmail, and AOL. To understand the impact of DKIM on getting into the inbox of your Yahoo, Gmail, AOL and other users, read through the <a href="http://www.dkim.org/">DKIM FAQ</a>.</p>
<p>Along with PHPMailer (and PHPMailer Lite) we will be providing a utility to:</p>
<ul>
<li>create DKIM Private key</li>
<li>create DKIM Public key</li>
<li>create DNS Resource Record entry</li>
<li>create PHPMailer resource code for your scripts</li>
</ul>
<p>The "Create DKIM Keys" utility will include a form to fill in your domain, email identity, DNS resource record selector, and passphrase for the DKIM keys.</p>
<p>The second major feature of PHPMailer is support for callback function. The results of each email send transaction will be passed to a callback function that you control entirely. The parameters passed include success flag, recipient, cc, bcc, subject, and email body. Based on receiving these parameters in your callback function, you can easily pass the results as an echo back to the screen, build CSV logs, update database records, etc. The possibilities are endless and provide you total control. Example callback functions will be included in the release. Think of it -- immediate feedback on sending status, plus all the information to update your databases.</p>
<p>Release date is fairly soon, anyone wanting to beta test prior to launch (with commitments to feedback in a timely manner) can contact me.</p>
<p>Andy</p><div class="item_footer"><p><small><a href="http://blog.worxware.com/blog1.php/2009/09/15/dkim-and-callback-function-for-phpmailer">Original post</a> blogged on <a href="http://b2evolution.net/">b2evolution</a>.</small></p></div>]]></content:encoded>
								<comments>http://blog.worxware.com/blog1.php/2009/09/15/dkim-and-callback-function-for-phpmailer#comments</comments>
			<wfw:commentRss>http://blog.worxware.com/blog1.php?tempskin=_rss2&#38;disp=comments&#38;p=39</wfw:commentRss>
		</item>
			</channel>
</rss>

