From 99b3ecbaf20b4e47ee6a403fd30268939e6e1244 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 25 Jan 2013 02:49:26 +0100 Subject: Updated and redocumented Fripost::Schema::Domain. --- lib/Fripost/Schema/Mail.pm | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 lib/Fripost/Schema/Mail.pm (limited to 'lib/Fripost/Schema/Mail.pm') diff --git a/lib/Fripost/Schema/Mail.pm b/lib/Fripost/Schema/Mail.pm new file mode 100644 index 0000000..309dad8 --- /dev/null +++ b/lib/Fripost/Schema/Mail.pm @@ -0,0 +1,58 @@ +package Fripost::Schema::Mail; + +=head1 NAME + +Mail.pm - Send clear, signed or encrypted e-mails. + +=head1 DESCRIPTION + +This module is adds GnuPG signing on top of MIME::Lite. Most of the +code comes from Mail::GnuPG. + +=cut + +use 5.010_000; +use strict; +use warnings; +use utf8; + +use MIME::Lite; + +sub new { + my $class = shift; + my $self = bless {}, $class; + my %msg = @_; + + $msg{Encoding} //= 'quoted-printable'; + $msg{Charset} //= 'utf-8'; + + $self->{_msg} = MIME::Lite->new(@_); + return $self; +} + +sub send { + my $self = shift; + print STDERR $self->{_msg}->as_string; + $self->{_msg}->send; +} + +=back + +=head1 AUTHOR + +Guilhem Moulin C<< >> + +=head1 COPYRIGHT + +Copyright 2013 Guilhem Moulin. + +=head1 LICENSE + +This program is free software; you can redistribute it and/or modify it +under the same terms as perl itself. + +=cut + +1; + +__END__ -- cgit v1.2.3