FAQ
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 => 'admin@tristatelogic.com',
      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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 11 of 23 | next ›
Discussion Overview
groupbeginners @
categoriesperl
postedOct 23, '13 at 10:18p
activeOct 25, '13 at 5:30a
posts23
users8
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase