"J. Shirley via RT" writes:
Show quoted text> On Wed Dec 22 16:55:53 2010, ANSGAR wrote:
>> In Catalyst::View::Email::process, the mail is sent using this line:
>>
>> my $return = sendmail( $message, { transport => $self->_mailer_obj } );
>>
>> This makes it impossible to specify envelope recipient and sender
>> independent from the values used in the To, CC, From headers. To make
>> this possible additional options have to be passed to the sendmail call:
>>
>> sendmail($email, { to => [ $to_1, $to_2 ], from => $sender });
>> (from Email::Sender::Manual::QuickStart)
>
> I'm not too sure what you mean. What are you trying to achieve that passing in header => [ ]
> or just $c->stash->{email}->{to} doesn't provide?
I want to use a From address in the envelope that in different from the
From address used in the header. By default the envelope sender and
recipients are generated from the "From", "To", "Cc", "Bcc" headers, but
they can be specified manually as well (which is required to use
different From addresses in the envelope and header).
As far as I understand, $c->stash->{email}->{to} and header => [ ... ]
only allow to set the values used in the headers, but not to set the
envelope information to a different value.
There is some more description in the Email::Sender::Manual::QuickStart
documentation:
--8<---------------cut here---------------start------------->8---
envelope information
We didn't have to tell Email::Sender::Simple where to send the message.
If you don't specify recipients, it will use all the email addresses it
can find in the To and Cc headers by default. It will use
Email::Address to parse those fields. Similarly, if no sender is
specified, it will use the first address found in the From header.
In most email transmission systems, though, the headers are not by
necessity tied to the addresses used as the sender and recipients. For
example, your message header might say "From: mailing-list@example.com"
while your SMTP client says "MAIL FROM:<verp-1234@lists.example.com>".
This is a powerful feature, and is necessary for many email application.
Being able to set those distinctly is important, and
Email::Sender::Simple lets you do this:
sendmail($email, { to => [ $to_1, $to_2 ], from => $sender });
--8<---------------cut here---------------end--------------->8---
So I would like some way to pass these options to Email::Sender.
Regards,
Ansgar