Closed fany closed 10 years ago
I don't think your code does what you described. You are just overwriting the from
field with the sender
:
+ $sendmail_arg{from} = $sender if defined $sender;
What am I missing?
I don't think your code does what you described. You are just overwriting the
from
field with thesender
:+ $sendmail_arg{from} = $sender if defined $sender;
What am I missing?
%sendmail_arg is later passed as second argument to the sendmail() function imported from Email::Sender::Simple:
return sendmail $email, \%sendmail_arg;
This function expects the envelope sender like this, see example at http://metacpan.org/pod/Email::Sender::Manual::QuickStart#envelope-information
The From header field is passed in the $email object and is not influenced by my change.
Regards, fany
I see now. Thanks!
As stated in Email::Sender::Manual::QuickStart, it is sometimes necessary to be able to set the e-mail sender (e.g. MAIL FROM in the envelope) to a different address than the address given in the From header line.
This patch enables you to do this by passing a "sender" key to Dancer::Plugin::Email. I am not sure, if this is the most reasonable implementation, though – suggestions welcome!