<?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>Design Gala &#187; html email</title>
	<atom:link href="http://designgala.com/tag/html-email/feed/" rel="self" type="application/rss+xml" />
	<link>http://designgala.com</link>
	<description>Web Usability, Web Technology, User Experience</description>
	<lastBuildDate>Sat, 11 Jun 2011 02:38:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Email HTML page contents using PHP</title>
		<link>http://designgala.com/email-html-page-contents-using-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=email-html-page-contents-using-php</link>
		<comments>http://designgala.com/email-html-page-contents-using-php/#comments</comments>
		<pubDate>Wed, 17 May 2006 14:50:44 +0000</pubDate>
		<dc:creator>Design Gala</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[html email]]></category>

		<guid isPermaLink="false">http://www.designgala.com/email-html-page-contents-using-php/</guid>
		<description><![CDATA[Earlier post explained on {{post id="how-to-send-e-mail-using-php" text="how to send a plain email using PHP"}}. This time, we are discussing about sending page contents to email. This technique is based on output buffering. Basically, it would first create read a html file and store in buffer using ob_start(). Next step is to include desire HTML page using include function and then store the contents of that HTML page using ob_get_contents(). Finally use mail() function to send email.]]></description>
			<content:encoded><![CDATA[<p>Earlier post explained on <a href="http://www.designgala.com/how-to-send-e-mail-using-php/">how to send a plain email using PHP</a>. This time, we are discussing about sending page contents to email. This technique is based on output buffering. Basically, it would first create read a html file and store in buffer using <em>ob_start()</em>. Next step is to include desire HTML page using include function and then store the contents of that HTML page using <em>ob_get_contents()</em>. Finally use <em>mail()</em> function to send email.</p>
<blockquote><p>While output buffering is turned on no output is sent from then script. The output is stored in an internal buffer.</p></blockquote>
<div class="wp_syntax">
<div class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;samplepage.html&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ob_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ob_end_clean</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'MIME-Version: 1.0'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'Content-type: text/html; charset=iso-8859-1'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'From: '</span><span style="color: #339933;">.</span>SENDER_NAME<span style="color: #339933;">.</span><span style="color: #0000ff;">' &amp;lt;'</span><span style="color: #339933;">.</span>SENDER_EMAIL<span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;gt; '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$to_email</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'email@example.net'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Your Desired Email Subject'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to_email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$buffer</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
</div>
</div>
<h3>Download Sample</h3>
<ol>
<li><a title="Demonstration of Email HTML" href="http://www.designgala.com/wp-content/uploads/2008/03/send_html_page_email.rar">Download (rar file)</a></li>
<li><a title="Demonstration of Email HTML" href="http://www.designgala.com/wp-content/uploads/2008/03/send_html_page_email.zip">Download (zip file)</a></li>
</ol>
<div id="fb-root"></div>
<p><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove --></p>
]]></content:encoded>
			<wfw:commentRss>http://designgala.com/email-html-page-contents-using-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

