Class-DBI-Factory

 view release on metacpan or  search on metacpan

lib/Class/DBI/Factory/Mailer.pm  view on Meta::CPAN


If you're having trouble with this, check your configuration's 'default_mailer' parameter, and compare against the documentation for L<Email::Send>. It has probably defaulted to Sendmail.

=cut

sub send_message {
	my ( $self, $instructions ) = @_;
	$self = $self->new unless ref $self;
	return unless $instructions->{subject} && $instructions->{to};
    $instructions->{from} ||= $self->config->get('mail_from');
	$instructions->{'content-type'} ||= ($instructions->{as_html}) ? 'text/html; charset="iso-8859-1"' : 'text/plain';

	my $message;
	my $header = join("\n", map("$_: " . $instructions->{lc($_)}, qw(To From Subject Content-Type)));
	$header .= "\n\n";
	
	if ($instructions->{template}) {
        $self->tt->process( $instructions->{template}, {
            factory => $self->factory,
            config => $self->config,
            date => $self->factory->now,



( run in 1.758 second using v1.01-cache-2.11-cpan-524268b4103 )