<div>Oi, pessoal. Utilizei o módulo SMTP::Lite.. Eu recebo o e-mail, mas o anexo não.. </div>
<div>&nbsp;</div>
<div><font size="2">
<p>#!/usr/bin/perl<br>use warnings;<br>use strict;<br>use CGI qw(:standard);<br>use Net::SMTP_auth;<br>use Net::SMTP;<br>use MIME::Lite;</p>
<p>my $hostsmtp=&#39;<a href="http://smtp.dominio.com.br">smtp.dominio.com.br</a>&#39;;<br>my <a href="mailto:$usuario=&#39;rafael@dominio.com.br&#39;">$usuario=&#39;rafael@dominio.com.br&#39;</a>;<br>my $senha=&#39;senha&#39;;
<br>my <a href="mailto:$from=&#39;rafael@dominio.com.br&#39;">$from=&#39;rafael@dominio.com.br&#39;</a>;<br>my <a href="mailto:$to=&#39;rafael@nexoinfo.com.br&#39;">$to=&#39;rafael@nexoinfo.com.br&#39;</a>;<br>my $mensagem=&quot;Teste de envio.&quot;;
<br>my $titulo=&#39;Backup do MSN Monitor&#39;;<br></p>
<p>my $smtp = Net::SMTP_auth-&gt;new(&quot;$hostsmtp&quot;, Timeout=&gt;60, Debug=&gt;1) || die<br>(&quot;erro: $!\n&quot;);</p>
<p>$smtp-&gt;auth(&#39;PLAIN&#39;,$usuario,$senha);<br>$smtp-&gt;mail($from);<br>$smtp-&gt;to($to);<br>$smtp-&gt;data();<br>$smtp-&gt;datasend(&quot;To: $to\n&quot;);<br>$smtp-&gt;datasend(&quot;From: $from\n&quot;);<br>
$smtp-&gt;datasend(&quot;Subject: $titulo\n&quot;);<br>$smtp-&gt;datasend(&quot;Content-type: text/html\n\n&quot;);<br>$smtp-&gt;datasend($mensagem);<br>$smtp-&gt;dataend();<br>$smtp-&gt;quit;</p>
<p>my $anexo = MIME::Lite-&gt;new ();</p>
<p>$anexo-&gt;attach(<br>Type =&gt;&#39;TEXT&#39;);<br>my $fileName = &#39;backup.tar.gz&#39;;<br>my $fileType = &#39;TEXT&#39;;<br>my $file = &#39;/var/log/[arquivo].tar.gz&#39;;<br>$anexo-&gt;attach(Type =&gt;$fileType,
<br>Path =&gt;$fileName,<br>Filename =&gt;$file,<br>Disposition =&gt;&#39;attachment&#39;<br>);<br>$anexo-&gt;send();<br></p>
<p>print &quot;Content-type: text/html\n\n&quot;;<br>print &quot;E-mail enviado!&quot;;</p></font><br><br>&nbsp;</div>