RE: Mime::Lite question.
by Oxley, Steven other posts by this author
Nov 6 2002 1:11AM messages near this date
view in the new Beta List Site
Outlook, Perl & OLE
|
RE: Mime::Lite question.
Remove the [] array reference and enclose the list of addresses in single
quotes. Then in the $msg-> add use double quotes around the variable.
use Mime::Lite;
my $ToList = 'user1@[...].com, user2@server.net';
my $ebody = "TEST EMAIL BODY";
my $msg;
# Define email object
$msg = MIME::Lite-> new(
From => 'user3@xo.com',
Subject => 'Test Email',
Type => 'multipart/related'
);
$msg-> add(To => "$ToList");
$msg-> attach(Type => 'text/html', Data => $ebody);
MIME::Lite-> send('smtp', "smtp.server.com", Timeout=>60);
$msg-> send;
Documentation can be found at
http://search.cpan.org/author/ERYQ/MIME-Lite-2.117/lib/MIME/Lite.pm
Steven Oxley
-----Original Message-----
From: Christopher Hahn [mailto:christopher.hahn@[...].com]
Sent: Tuesday, November 05, 2002 6:40 PM
To: Perl win32 email list (perl-win32-users@listserv.ActiveState.com)
Cc: Christopher Hahn
Subject: Mime::Lite question.
Hello,
I have this small test script that:
=======================================
use Mime::Lite;
my $ToList = [ "user1\@server.com", "user2\@server.com"];
my $ebody = "TEST EMAIL BODY";
my $msg;
# Define email object
$msg = MIME::Lite-> new(
From => 'user1@server.com',
Subject => "Test Email",
Type => 'multipart/related'
);
$msg-> add("To" => $ToList);
$msg-> attach(Type => 'text/html', Data => $ebody);
MIME::Lite-> send('smtp', "smtp.server.com", Timeout=>60);
$msg-> send;
=======================================
Only the first recipient, in ToList, receives the email. The second
recipient
appears on the header and look fine. In fact, if the first recipient
executes
a Reply-To-All (we are using "LookOut" (sic) for email here) then both users
get a copy of the reply. Reversing the order of the recipients switches who
get a copy.
I first added the users one-by-one, but assigning a arrayref is allowed.
Anyhow
they both had the same bad effect. I do not yet see what I am doing wrong.
Any pointers appreciated. (I am betting that this is another brain-dead
question!)
Christopher
--
There are only 10 types of people in the world:
Those who understand binary and those who don't.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|