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