<?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>AgênciaDot. Comunicação - Nosso negócio é web! - Fone: (11) 2671-4120 &#187; CDONTS</title>
	<atom:link href="http://www.agenciadot.com.br/tag/cdonts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.agenciadot.com.br</link>
	<description>AgênciaDot. Comunicação - Nosso negócio é web! - Fone: (11) 2671-4120</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:35:02 +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>Enviando e-mail com ASP e PHP</title>
		<link>http://www.agenciadot.com.br/enviando-e-mail-com-asp-e-php/</link>
		<comments>http://www.agenciadot.com.br/enviando-e-mail-com-asp-e-php/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 17:36:38 +0000</pubDate>
		<dc:creator>agenciadot</dc:creator>
				<category><![CDATA[hospedagem]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[CDONTS]]></category>
		<category><![CDATA[função mail()]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.agenciadot.com.br/?p=817</guid>
		<description><![CDATA[Na AgênciaDot. todas as hospedagens em ambiente Windows contam com o componente CDONTS e a função mail() do PHP habilitados. Estes componentes servem para realizar o envio de mensagens por e-mail através de formulários contidos no seu site. Caso opte por usar a linguagem ASP, recomendamos o uso do componente CDONTS, se sua aplicação baseia-se [...]]]></description>
			<content:encoded><![CDATA[<p>Na <strong>AgênciaDot.</strong> todas as hospedagens em ambiente Windows contam com o componente <strong>CDONTS</strong> e a função <strong>mail<span style="margin-right:3px;">(</span>)</strong> do PHP habilitados.</p>
<p>Estes componentes servem para realizar o envio de mensagens por e-mail através de formulários contidos no seu site. Caso opte por usar a linguagem ASP, recomendamos o uso do componente CDONTS, se sua aplicação baseia-se na linguagem PHP, pode ser utilizada a função mail<span style="margin-right:3px;">(</span>).</p>
<p><strong>Script em ASP para enviar e-mail através do componente CDONTS:</strong></p>
<blockquote style="margin-bottom:18px;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="asp" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">&lt;%</span>
    <span style="color: #008000;">'Criando a chamada para o objeto CDONTS</span>
    <span style="color: #990099; font-weight: bold;">Set</span> cdoMail <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #990099; font-weight: bold;">Server</span>.<span style="color: #330066;">CreateObject</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;CDONTS.NewMail&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
    cdoMail.<span style="color: #9900cc;">From</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;remetente@dominio.com.br&quot;</span>
    cdoMail.<span style="color: #990099; font-weight: bold;">To</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;destinatario@dominio.com.br&quot;</span>
    cdoMail.<span style="color: #9900cc;">Subject</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;Assunto do email&quot;</span>
    <span style="color: #008000;">'Tipo de formatacao</span>
    cdoMail.<span style="color: #9900cc;">BodyFormat</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span>
    cdoMail.<span style="color: #9900cc;">MailFormat</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #800000;">0</span>
    <span style="color: #008000;">'Corpo do email formatado em HTML</span>
    cdoMail.<span style="color: #9900cc;">Body</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;&lt;html&gt;&lt;body bgcolor='#FFFFFF'&gt;&quot;</span><span style="color: #006600; font-weight: bold;">&amp;</span> _
    <span style="color: #cc0000;">&quot;&lt;table border='0' cellpadding='0' cellspacing='0'&gt;&quot;</span><span style="color: #006600; font-weight: bold;">&amp;</span> _
    <span style="color: #cc0000;">&quot;&lt;tr&gt;&lt;td&gt;Exemplo de email&lt;/td&gt;&lt;/tr&gt;&quot;</span><span style="color: #006600; font-weight: bold;">&amp;</span> _
    <span style="color: #cc0000;">&quot;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;&quot;</span>
    <span style="color: #008000;">'Envia o email</span>
    cdoMail.<span style="color: #330066;">Send</span>
    <span style="color: #990099; font-weight: bold;">Set</span> cdoMail <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">Nothing</span>
    <span style="color: #990099; font-weight: bold;">response</span>.<span style="color: #330066;">write</span> <span style="color: #cc0000;">&quot;Email enviador com sucesso!&quot;</span>
    <span style="color: #000000; font-weight: bold;">%&gt;</span></pre></td></tr></table></div>

</blockquote>
<p>Veja mais em: <a href="http://support.microsoft.com/kb/186204" target="_blank">http://support.microsoft.com/kb/186204</a></p>
<p><strong>Script em PHP para enviar e-mail através da função mail<span style="margin-right:3px;">(</span>):</strong></p>
<blockquote style="margin-bottom:18px;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td 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;">// multiple recipients</span>
    <span style="color: #000088;">$to</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'destinatario@dominio.com.br'</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Assunto do email</span>
    <span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Assunto do email'</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Formatando o corpo da mensagem</span>
    <span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'
    &lt;html&gt;
    &lt;body&gt;
    &lt;table&gt;
    &lt;tr&gt;
    &lt;td&gt;Exemplo de email&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    '</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Configuracoes dos cabecalhos do email</span>
    <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;">'To: Nome &lt;destinatario@dominio.com.br&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>
    <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'From: Remetente &lt;remetente@dominio.com.br&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>
    <span style="color: #666666; font-style: italic;">// Para mais de um destinatario</span>
    <span style="color: #666666; font-style: italic;">//$headers .= 'Cc: destinatario_copia@dominio.com.br' . &quot;\r\n&quot;;</span>
    <span style="color: #666666; font-style: italic;">//Copia oculta para mais destinatarios</span>
    <span style="color: #666666; font-style: italic;">//$headers .= 'Bcc: destinatario_oculto@dominio.com.br' . &quot;\r\n&quot;;</span>
    <span style="color: #666666; font-style: italic;">// Enviando email</span>
    <span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Email enviado com sucesso&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

</blockquote>
<p>Veja mais em: <a href="http://br2.php.net/manual/en/function.mail.php" target="_blank">http://br2.php.net/manual/en/function.mail.php</a></p>
<h3  class="related_post_title">Leia também:</h3><ul class="related_post"><li><a href="http://www.agenciadot.com.br/blackfriday-pra-valer/" title="#BlackFriday pra valer!">#BlackFriday pra valer!</a></li><li><a href="http://www.agenciadot.com.br/programador-web-a-agenciadot-procura-por-voce/" title="Programador web: a AgênciaDot. procura por você!">Programador web: a AgênciaDot. procura por você!</a></li><li><a href="http://www.agenciadot.com.br/novidades-para-te-atender-melhor/" title="Novidades para te atender melhor">Novidades para te atender melhor</a></li><li><a href="http://www.agenciadot.com.br/filtragem-de-spam/" title="Filtragem de Spam">Filtragem de Spam</a></li><li><a href="http://www.agenciadot.com.br/agenciadot-no-twitter/" title="AgênciaDot. no Twitter">AgênciaDot. no Twitter</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.agenciadot.com.br/enviando-e-mail-com-asp-e-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

