ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
RE: Mime::Lite question.
by Christopher Hahn other posts by this author
Nov 6 2002 1:39AM messages near this date
view in the new Beta List Site
RE: Mime::Lite question. | Re: Mime::Lite question.
Steven,

Thank you for the suggestion.  I will try this.

I did check the docs.  This is where I got the idea of just using the
arrayref, where initially I was looping iterating through the list, adding
each recipient.  So I guess the docs are in error where they refer to 
"arrayref" below:
=========================
Giving VALUE as an arrayref will cause all those values to be added. 
This is only useful for special multiple-valued fields like "Received": 
=========================
(From:
http://search.cpan.org/author/ERYQ/MIME-Lite-2.117/lib/MIME/Lite.pm#Setting_
getting_headers_and_attributes)

I expect that "To" is a "multiple-valued" field.....but is it "special"? :-)

Thank you again for taking the time,

Christopher

-----Original Message-----
From: Oxley, Steven [mailto:steven.oxley@[...].com] 
Sent: Tuesday, November 05, 2002 5:11 PM
To: 'Christopher Hahn'; Perl win32 email list
(perl-win32-users@listserv.ActiveState.com)
Subject: 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
Thread:
Christopher Hahn
Sisyphus
Thomas Drugeon
$Bill Luebkert

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved