<?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/"
	>

<channel>
	<title>Noel Rocha &#187; 2008 &#187; July</title>
	<atom:link href="http://www.noelrocha.com/blog/2008/07/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.noelrocha.com/blog</link>
	<description>Capacitando o sistema...</description>
	<pubDate>Sun, 07 Jun 2009 22:09:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Melhores extensões do firefox 3</title>
		<link>http://www.noelrocha.com/blog/2008/07/22/melhores-extensoes-do-firefox-3/</link>
		<comments>http://www.noelrocha.com/blog/2008/07/22/melhores-extensoes-do-firefox-3/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 11:59:18 +0000</pubDate>
		<dc:creator>Noel Rocha</dc:creator>
		
		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[Outros]]></category>

		<category><![CDATA[Programação]]></category>

		<guid isPermaLink="false">http://www.noelrocha.com/blog/?p=12</guid>
		<description><![CDATA[Desde que comecei a utilizar o firefox virei um addonsmaniac, isso mesmo, um maluco por extensão do firefox. Já experimentei diversas extensões e acabei percebendo que meu vício pelo firefox e extensões só aumentava.  
E agora também sou maluco por themas leves e bonitos.
Vou separar uns addons e themas que são super úteis e [...]]]></description>
			<content:encoded><![CDATA[<p>Desde que comecei a utilizar o firefox virei um <strong><em>addonsmaniac</em></strong>, isso mesmo, um maluco por extensão do firefox. Já experimentei diversas extensões e acabei percebendo que meu vício pelo firefox e extensões só aumentava. <img src='http://www.noelrocha.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>E agora também sou maluco por themas leves e bonitos.</p>
<p>Vou separar uns addons e themas que são super úteis e bonitos e vou postar ao longo da semana.</p>
<p><strong>Firebug:<br />
</strong></p>
<p><a href="https://addons.mozilla.org/en-US/firefox/images/preview/1843/2" target="_blank"><img class="alignleft" style="vertical-align: text-top;" src="https://addons.mozilla.org/en-US/firefox/images/addon_preview/1843/2" alt="" width="200" height="150" /></a><a href="https://addons.mozilla.org/en-US/firefox/addon/1843" target="_new"></a> Permite você alterar o código de uma página e ver a alteração no exato momento. Depois que você altera o código não é necessário atualizar a página, a modificação faz efeito no mesmo momento.</p>
<p>Ele também possui uma opção para verificar o carregamento da página possibilitando saber o que demorou mais para carregar em seu site. Uma excelente ferramenta para webmaster.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/images/preview/1843/4" target="_blank"><img class="alignleft" style="float: left;" src="https://addons.mozilla.org/en-US/firefox/images/addon_preview/1843/4" alt="Firebug" width="200" height="150" /></a></p>
<p>Uma alternativa a esse recurso oferecido pelo firebug é o <a href="http://tools.pingdom.com/" target="_blank">http://tools.pingdom.com/</a><strong> </strong>que permite verificar em quanto tempo a página foi carregada e também quais aplicativos demoraram mais para isso. Essa ferramenta é OnLine e não precisa instalar nenhuma aplicativo em seu computador.</p>
<p><a href="https://addons.mozilla.org/en-US/firefox/addon/1843" target="_new">https://addons.mozilla.org/en-US/firefox/addon/1843</a></p>
<p><strong>ShowIP</strong>:</p>
<p><img class="alignleft" style="float: left;" src="https://addons.mozilla.org/en-US/firefox/images/addon_preview/590/3" alt="" width="200" height="150" /></p>
<p>Mostra o ip do site que você está acessando. Bem interessante, poupa um comando host/ping. Essa extensão tem suporte a IPv6.</p>
<p><a href="https://addons.mozilla.org/pt-BR/firefox/addon/590" target="_blank">https://addons.mozilla.org/pt-BR/firefox/addon/590</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.noelrocha.com/blog/2008/07/22/melhores-extensoes-do-firefox-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Como enviar emails autenticados pelo Gmail/Google Apps</title>
		<link>http://www.noelrocha.com/blog/2008/07/21/como-enviar-emails-autenticados-pelo-gmailgoogle-apps/</link>
		<comments>http://www.noelrocha.com/blog/2008/07/21/como-enviar-emails-autenticados-pelo-gmailgoogle-apps/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 15:56:30 +0000</pubDate>
		<dc:creator>Noel Rocha</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Email]]></category>

		<category><![CDATA[Programação]]></category>

		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.noelrocha.com/blog/?p=11</guid>
		<description><![CDATA[Olá pessoal,
Essa semana tive que criar um script para envio de emails através do Gmail porém o servidor que estou hospedado permite apenas o envio autenticado e o Gmail aceita apenas envio autenticado.
Logo a função mail() do php não pode me ajudar em nada, pois ela não faz o envio autenticado  
Nesse momento o [...]]]></description>
			<content:encoded><![CDATA[<p>Olá pessoal,</p>
<p>Essa semana tive que criar um script para envio de emails através do Gmail porém o servidor que estou hospedado permite apenas o envio autenticado e o Gmail aceita apenas envio autenticado.</p>
<p>Logo a função mail() do php não pode me ajudar em nada, pois ela não faz o envio autenticado <img src='http://www.noelrocha.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Nesse momento o pear salvou minha pele. Utilizando a biblioteca Pear::Mail consegui realizar esse envio.<br />
<a href="http://pear.php.net/package/Mail" target="_blank">http://pear.php.net/package/Mail</a></p>
<p>O Pear::Mail nos servidores PHP da <a href="http://www.hostnet.com.br" target="_blank">HostNet</a> já está instalado por padrão, que show =)</p>
<p>Para realizar o envio tanto autenticado bastou utilizar o script abaixo:</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: #666666; font-style: italic;">// Incluindo arquivo com a classe Mail</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Mail.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Destinatário da mensagem</span>
<span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;suporte@hostnet.com.br&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Assunto da mensagem</span>
<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Testando envio autenticado pelo Google Apps&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
 Corpo da mensagem
 Em caso de formulário alterar para a variável $_POST['CAMPO']
*/</span>
<span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Teste efetuado com sucesso!&quot;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">// Servidor do Gmail</span>
<span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ssl://smtp.gmail.com&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Email do Gmail que fará o envio autenticado</span>
<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;noel@noelrocha.com&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Sua senha do GMAIL</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'SECRETA'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'From'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$from</span><span style="color: #339933;">,</span>
                            <span style="color: #0000ff;">'To'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$to</span><span style="color: #339933;">,</span>
                            <span style="color: #0000ff;">'Subject'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$subject</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$smtp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">Mail</span><span style="color: #339933;">::</span><span style="color: #004000;">factory</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'smtp'</span><span style="color: #339933;">,</span>
                                <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'host'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$host</span><span style="color: #339933;">,</span>
                                          <span style="color: #0000ff;">'port'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">465</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// SMTPS(para mais detalhes ver /etc/services</span>
                                          <span style="color: #0000ff;">'auth'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
                                          <span style="color: #0000ff;">'debug'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Debug ligado</span>
                                          <span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$username</span><span style="color: #339933;">,</span>
                                          <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span>
                                  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Efetuando o envio autenticado</span>
<span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$smtp</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Verificando se houve erro</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>PEAR<span style="color: #339933;">::</span><span style="color: #004000;">isError</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mail</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Email enviado com sucesso!!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Caso ocorra o erro abaixo(Debug tem que estar ligado para ver):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">DEBUG<span style="color: #339933;">:</span> Recv<span style="color: #339933;">:</span> <span style="color: #cc66cc;">535</span><span style="color: #339933;">-</span>5<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>1 Username and Password not accepted<span style="color: #339933;">.</span> Learn more at
DEBUG<span style="color: #339933;">:</span> Recv<span style="color: #339933;">:</span> <span style="color: #cc66cc;">535</span> 5<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>1 http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//mail.google.com/support/bin/answer.py?answer=14257</span>
DEBUG<span style="color: #339933;">:</span> Send<span style="color: #339933;">:</span> RSET
&nbsp;
DEBUG<span style="color: #339933;">:</span> Recv<span style="color: #339933;">:</span> <span style="color: #cc66cc;">250</span> 2<span style="color: #339933;">.</span>1<span style="color: #339933;">.</span>0 Flushed 
&nbsp;
 authentication failure <span style="color: #009900;">&#91;</span>SMTP<span style="color: #339933;">:</span> Invalid response code received from server <span style="color: #009900;">&#40;</span>code<span style="color: #339933;">:</span> <span style="color: #cc66cc;">535</span><span style="color: #339933;">,</span> response<span style="color: #339933;">:</span> 5<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>1 Username and Password not accepted<span style="color: #339933;">.</span> Learn more at
5<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>1 http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//mail.google.com/support/bin/answer.py?answer=14257)]</span>
&nbsp;
DEBUG<span style="color: #339933;">:</span> Send<span style="color: #339933;">:</span> QUIT
&nbsp;
DEBUG<span style="color: #339933;">:</span> Recv<span style="color: #339933;">:</span> <span style="color: #cc66cc;">221</span> 2<span style="color: #339933;">.</span>0<span style="color: #339933;">.</span>0 mx<span style="color: #339933;">.</span>google<span style="color: #339933;">.</span>com closing connection</pre></div></div>

<p>ou abaixo:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">p<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> authentication failure <span style="color: #009900;">&#91;</span>SMTP<span style="color: #339933;">:</span> Invalid response code received from server <span style="color: #009900;">&#40;</span>code<span style="color: #339933;">:</span> <span style="color: #cc66cc;">535</span><span style="color: #339933;">,</span> response<span style="color: #339933;">:</span> 5<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>1 Username and Password not accepted<span style="color: #339933;">.</span> Learn more at
5<span style="color: #339933;">.</span>7<span style="color: #339933;">.</span>1 http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//mail.google.com/support/bin/answer.py?answer=14257 )]</span></pre></div></div>

<p>Será necessário acessar o endereço <a href="https://www.google.com/accounts/DisplayUnlockCaptcha" target="_blank">https://www.google.com/accounts/DisplayUnlockCaptcha</a> para contas que  sejam do Gmail e https://www.google.com/a/[<strong>SEU_DOMINIO_DO_GOOGLE_APPS</strong>]/UnlockCaptcha e depois <strong>desbloquear</strong> o envio de emails sem a utilização de <strong>Captcha</strong>. Nesse endereço será necessário digitar a sua conta(sem o @ e o domínio) e a senha da mesma.</p>
<p>Caso ocorra o erro abaixo, é porque o servidor que o script está possui proteção na porta <strong>465</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: Connection refused
(code: -1, response: )]</pre></div></div>

<p><strong>Obs.: <em>Esse procedimento deverá ser realizado para cada novo servidor que o script esteja rodando.</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.noelrocha.com/blog/2008/07/21/como-enviar-emails-autenticados-pelo-gmailgoogle-apps/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
