for send an email part II
- From: daredevil@xxxxxxxxxxx (Rafael Morales)
- Date: Fri, 30 Dec 2005 03:53:52 +0800
Well I have done this code, but the messages arrive in white :(, anybody could help me with this please ???.
Note: I do not know the list of users for that reason I need multipart.
Regards
#!/usr/bin/perl
use strict;
use warnings;
my $msg_html = "message.html";
my $msg_txt = "message.txt";
open (MAIL, "|/usr/sbin/sendmail -t") || die "No hay acceso al binario sendmail\n";
open (HTML, "$msg_html") || die "Html no existe\t$!\n";
open (TXT, "$msg_txt") || die "Txt no existe\t$!\n";
my @html = <HTML>;
my @txt = <TXT>;
my $boundary = "=_" . time();
$boundary = '"' . '----' . $boundary . '"';
my $To = 'user@xxxxxxxxxx';
my $FromMail = 'sender@xxxxxxxxxxxxx';
my $FromName = 'Sender Name';
my $Bcc = 'other@xxxxxxxxxx';
my $Subject = "Testing multipart";
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: multipart/alternative; boundary= $boundary\n";;
print MAIL "From: $FromName<$FromMail>\n";
print MAIL "To: $To\n";
print MAIL "Cc: $Bcc\n";
print MAIL "Subject: $Subject\n";
my $correo = <<"MAIL_BODY";
$boundary
Content-Type: text/plain;
charset= "iso-8859-1"
Content-Transfer-Encoding: 8bit
@txt
$boundary
Content-Type: text/html;
charset= "iso-8859-1"
Content-Transfer-Encoding: quoted-printable
@html
$boundary
MAIL_BODY
print MAIL "$correo\n";
--
_______________________________________________
Get your free email from http://mymail.bsdmail.com
.
- Follow-Ups:
- Re: for send an email part II
- From: Dr.Ruud
- Re: for send an email part II
- Prev by Date: RE: regular expression
- Next by Date: Re: for send an email part II
- Previous by thread: using an system call for decryption
- Next by thread: Re: for send an email part II
- Index(es):
Relevant Pages
|