Another way of handling is to use one of the availabe Email::* modules
on CPAN. This would have the advantages of (beside you don't have to
worry about details of string quoting):
- better code, as you write down what you intend to do instead of how
you do it
- better security, as those modules already handles (hopefully) the
security breaches
- you don't have to think a lot of stuff other have already thought a
lot about --> Don't Repeat Yourself or other ones
For example [untested]:
use Email::Simple;
my $email = Email::Simple->create(
header => [
From => $sender_addr,
To => '[email protected]',
X-Server-Protocol => $server_protocol,
X-Http-User-Agent => $http_user_agent,
X-Http-Referer => $http_referer,
X-Remote-Addr => $remote_addr,
X-Remote-Host => $remote_host,
],
body => $message
);
print $email->as_string;
Greetings,
Janek
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/