Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 43703
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: aver [...] pvk.org.ru
Cc: icestar [...] inbox.ru
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.087
Fixed in: (no value)



Subject: Upgrade generic field to structured address field when adding fields 'To', 'Cc', etc.
As described in perldoc Mail::Message::Field::Addresses I tried this code: === my $cc = Mail::Message::Field−>new(’Cc’); $cc−>addAddress(’Mail::Box <test@mail.box>’); $cc−>addAddress( phrase => ’Mail::Box’, email => ’test@mail.box'); === But it doesn't work. It would be nice to "upgrade" the field type automatically.
Sorry the answer took so long. "Mail::Message::Field" is the "old", simple and fast implementation. "Mail::Message::Field::Full" is the base class of the full field understanding model, with unicode and such nastiness. So, $m = Mail::Message::Field->new('Cc'); does not upgrade, but $m = Mail::Message::Field::Full->new('Cc'); does the job.
On Tue Jun 02 05:35:08 2009, MARKOV wrote: Show quoted text
> Sorry the answer took so long. > > "Mail::Message::Field" is the "old", simple and fast implementation. > "Mail::Message::Field::Full" is the base class of the full field > understanding model, with unicode and such nastiness. So, > $m = Mail::Message::Field->new('Cc'); > does not upgrade, but > $m = Mail::Message::Field::Full->new('Cc'); > does the job.
Why you didn't fix it in your documentation?
Subject: Re: [rt.cpan.org #43703] Upgrade generic field to structured address field when adding fields 'To', 'Cc', etc.
Date: Fri, 27 Nov 2009 10:28:05 +0100
To: Dmitry Bigunyak via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Dmitry Bigunyak via RT (bug-Mail-Box@rt.cpan.org) [091127 09:03]: Show quoted text
> Queue: Mail-Box > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=43703 > > > On Tue Jun 02 05:35:08 2009, MARKOV wrote:
> > Sorry the answer took so long. > > > > "Mail::Message::Field" is the "old", simple and fast implementation. > > "Mail::Message::Field::Full" is the base class of the full field > > understanding model, with unicode and such nastiness. So, > > $m = Mail::Message::Field->new('Cc'); > > does not upgrade, but > > $m = Mail::Message::Field::Full->new('Cc'); > > does the job.
> > Why you didn't fix it in your documentation?
What is there to fix in the documentation? The user has two choices: 1) quick, and correct in most cases 2) slower and always correct Some people prefer quick. -- Regards, MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Show quoted text
> > What is there to fix in the documentation? The user has two choices: > 1) quick, and correct in most cases > 2) slower and always correct > > Some people prefer quick.
Your example in Mail::Message::Field::Addresses module my $cc = Mail::Message::Field->new('Cc'); $cc->addAddress('Mail::Box <test@mail.box>'); $cc->addAddress( phrase => 'Mail::Box', email => 'test@mail.box'); doesn't work. If I run this I get: "Method addAddress() is not defined for a Mail::Message::Field::Fast." With Mail::Message::Field::Full there are some warnings.
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #43703] Upgrade generic field to structured address field when adding fields 'To', 'Cc', etc.
Date: Fri, 27 Nov 2009 11:40:36 +0100
To: Dmitry Bigunyak via RT <bug-Mail-Box [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Dmitry Bigunyak via RT (bug-Mail-Box@rt.cpan.org) [091127 09:54]: Show quoted text
> Queue: Mail-Box > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=43703 > > > Your example in Mail::Message::Field::Addresses module > my $cc = Mail::Message::Field->new('Cc'); > $cc->addAddress('Mail::Box <test@mail.box>'); > $cc->addAddress( phrase => 'Mail::Box', email => 'test@mail.box'); > > doesn't work. If I run this I get: > "Method addAddress() is not defined for a Mail::Message::Field::Fast." > > With Mail::Message::Field::Full there are some warnings.
Hum. That's the disadvantage of writing documentation before the development process has completed. I have fixed and extended the SYNOPSIS: my $cc = Mail::Message::Field::Full->new('Cc'); my $me = Mail::Message::Field::Address->parse('"Mail::Box" <test@mail.box>') or die; my $other = Mail::Message::Field::Address->new (phrase => 'Testing', address => 'other@example.com') or die; $cc->addAddress($me); $cc->addAddress($other, group => 'them'); $cc->addAddress(phrase => 'third', address => 'more@any.museum' , group => 'them'); my $group = $cc->addGroup(name => 'collegues'); $group->addAddress($me); $group->addAddress(phrase => "You", address => 'you@example.com'); my $msg = Mail::Message->build(Cc => $cc); print $msg->string; Thanks for pointing me to the mistakes. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Show quoted text
> > Thanks for pointing me to the mistakes.
Thanks for your quick response. :)
Will be fixed in 2.093, released within a week