<?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>The Zend Framework in Practice &#187; Zend_Mail</title>
	<atom:link href="http://zf.gm-ram.com/topics/zend_mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://zf.gm-ram.com</link>
	<description>Developing Web Applications with the Zend Framework</description>
	<lastBuildDate>Mon, 02 Jan 2012 10:20:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The Contact Page: Sending the E-mail</title>
		<link>http://zf.gm-ram.com/posts/the-contact-page-sending-the-e-mail/</link>
		<comments>http://zf.gm-ram.com/posts/the-contact-page-sending-the-e-mail/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 22:48:47 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Zend_Mail]]></category>

		<guid isPermaLink="false">http://zf.gm-ram.com/?p=454</guid>
		<description><![CDATA[The sending of the e-mail generated when the user submits a message via the contact page is handled by a class with a single method. This makes use of the Zend_Mail module to create and transmit the e-mail. The class is implemented as follows: &#60;?php class Default_Model_Mail_Contact &#123; public function send&#40;$bodyHtml&#41; &#123; // Send the [...]]]></description>
			<content:encoded><![CDATA[<p>The sending of the e-mail generated when the user submits a message via the contact page is handled by a class with a single method. This makes use of the Zend_Mail module to create and transmit the e-mail.<span id="more-454"></span></p>
<p>The class is implemented as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> Default_Model_Mail_Contact
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> send<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bodyHtml</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Send the mail</span>
    <span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Mail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBodyHtml</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bodyHtml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setFrom</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'website@example.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Website'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addTo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin@example.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Admin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setSubject</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Re: Message submitted via website'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The send method creates a mail, which is sent to the account of the person who is responsible for handling enquiries. Most of the fields are fixed, except for the message body, which is generated in the action handler, then passed to the method.</p>
]]></content:encoded>
			<wfw:commentRss>http://zf.gm-ram.com/posts/the-contact-page-sending-the-e-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

