[SP-pm] SendMail
Otávio Fernandes
otaviof em gmail.com
Segunda Janeiro 7 10:03:16 PST 2008
Olha, nao quero fazer vc reinventar a roda, mas o MIME::Lite eh muito
bom e simples, veja:
### Create a new multipart message:
$msg = MIME::Lite->new(
From =>'me em myhost.com',
To =>'you em yourhost.com',
Cc =>'some em other.com, some em more.com',
Subject =>'A message with 2 parts...',
Type =>'multipart/mixed'
);
### Add parts (each "attach" has same arguments as "new"):
$msg->attach(
Type =>'TEXT',
Data =>"Here's the GIF file you wanted"
);
$msg->attach(
Type =>'image/gif',
Path =>'aaa000123.gif',
Filename =>'logo.gif',
Disposition => 'attachment'
);
### use Net:SMTP to do the sending
$msg->send('smtp','some.host', Debug=>1 );
http://search.cpan.org/~rjbs/MIME-Lite-3.021/lib/MIME/Lite.pm
boa sorte,
On Jan 7, 2008 3:42 AM, Savio Silva <naboa2002 em hotmail.com> wrote:
>
> Ola,
>
> Alguem poderia dizer se e possivel e como incrementar uma menssagem para ser
> enviada pelo sendmail.
> gostaria se possivel enviar uma img jpg anexada ao email.
> ou melhor enviar um texto formatado em HTML para ser visualizado dentro do
> email
>
> $from="savio em example.com";
> #$to=$clientes;
> $subject="plin plin plin plin";
> $sendmail path="/usr/sbin/sendmail"; open (sendmail, "¦ $sendmailpath -t");
>
> foreach my $id (@listaClientes) {
> print sendmail "Subject: $subject\n";
> print sendmail "From: $from\n";
> print sendmail "To: $id\n\n";
> print sendmail"Test e-mail.\n\n";
> print sendmail "- finish";
>
> }
> close (sendmail);
>
>
>
> vlw
>
>
> ________________________________
> Veja mapas e encontre as melhores rotas para fugir do trânsito com o Live
> Search Maps! Experimente já!
> _______________________________________________
> SaoPaulo-pm mailing list
> SaoPaulo-pm em pm.org
> http://mail.pm.org/mailman/listinfo/saopaulo-pm
>
--
| --
| Otávio Fernandes < otaviof | gmail | com >
| FreeBSD 7.0-PRERELEASE && GNU/Linux User: 283.396
| (( Especial Programação )) http://geekbr.podcastbrasil.com/ -- 0.15
| --
Mais detalhes sobre a lista de discussão SaoPaulo-pm