<?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>ThinkRobot &#187; smtp</title>
	<atom:link href="http://think-robot.com/tag/smtp/feed/" rel="self" type="application/rss+xml" />
	<link>http://think-robot.com</link>
	<description>Design &#38; Development Blog</description>
	<lastBuildDate>Sun, 22 Apr 2012 23:58:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Using Zend_Mail and Google SMTP to send emails</title>
		<link>http://think-robot.com/2008/12/using-zend_mail-and-google-smtp-to-send-emails/</link>
		<comments>http://think-robot.com/2008/12/using-zend_mail-and-google-smtp-to-send-emails/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 19:15:11 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[emails]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.think-robot.com/?p=21</guid>
		<description><![CDATA[You can set this globally, for example in your bootstrap.php file: $tr = new Zend_Mail_Transport_Smtp('smtp.gmail.com', array( 'auth' =&#62; 'login', 'username' =&#62; 'YOUR_USERNAME@gmail.com', 'password' =&#62; 'YOUR_PASSWORD', 'ssl' =&#62; 'ssl', 'port' =&#62; 465) ); Zend_Mail::setDefaultTransport($tr); And later just use the normal Zend_Mail function as usual: $mail = new Zend_Mail(); $mail-&#62;setBodyHtml('Your html email here.'); $mail-&#62;addTo('send_to@mail.com'); $mail-&#62;setSubject('Mail Subject'); $mail-&#62;setFrom('from@mail.com'); [...]]]></description>
			<content:encoded><![CDATA[<p>You can set this globally, for example in your bootstrap.php file:</p>
<pre>$tr = new Zend_Mail_Transport_Smtp('smtp.gmail.com', array(
	'auth' =&gt; 'login',
	'username' =&gt; 'YOUR_USERNAME@gmail.com',
	'password' =&gt; 'YOUR_PASSWORD',
	'ssl' =&gt; 'ssl',
	'port' =&gt; 465)
);
Zend_Mail::setDefaultTransport($tr);</pre>
<p><span id="more-21"></span></p>
<p>And later just use the normal Zend_Mail function as usual:</p>
<pre>$mail = new Zend_Mail();
$mail-&gt;setBodyHtml('Your html email here.');
$mail-&gt;addTo('send_to@mail.com');
$mail-&gt;setSubject('Mail Subject');
$mail-&gt;setFrom('from@mail.com');
$mail-&gt;send();</pre>
<p>To quickly explain the settings:<br />
You need to set the authentication type to login, and provide your Google email and password, as obviously to prevent spam Google needs some verification of who you are. Then we specify the ssl type: Zend supports tls and ssl, and for Google we need to specify the later one. This also means that we need to use port <strong>465</strong> instead of the standard <strong>25</strong>.</p>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2010/12/php_auth_user-and-php_auth_pw-is-null/" rel="bookmark">PHP_AUTH_USER and PHP_AUTH_PW is null</a></li><li><a href="http://think-robot.com/2011/01/enable-delayed-messages-in-zend_queue/" rel="bookmark">Enable delayed messages in Zend_Queue</a></li><li><a href="http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/" rel="bookmark">Doctrine Many To Many With Extra Fields</a></li><li><a href="http://think-robot.com/2008/08/server-error-500-htaccess-require-valid-user/" rel="bookmark">Server Error 500 - htaccess require valid-user</a></li><li><a href="http://think-robot.com/2008/10/display-meetings-from-entourage-using-geektool/" rel="bookmark">Display Meetings From Entourage Using GeekTool</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/12/using-zend_mail-and-google-smtp-to-send-emails/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

