Haineko::SMTPD::Relay::Screen - Just print an email message
Haineko::SMTPD::Relay::Screen is a dummy connection class for printing an email message to Standard error device. This mailer is useful to debug.
use Haineko::SMTPD::Relay::Screen; my $h = { 'Subject' => 'Test', 'To' => 'neko@example.org' }; my $v = { 'mail' => 'kijitora@example.jp', 'rcpt' => 'neko@example.org', 'head' => $h, 'body' => 'Email message', }; my $e = Haineko::SMTPD::Relay::Screen->new( %$v ); my $s = $e->sendmail; print $s; # 1 = Always return 1 print $e->response->error; # 0 = Always return 0 print $e->response->dsn; # D.S.N. is always "undef" warn Data::Dumper::Dumper $e->response; $VAR1 = bless( { 'dsn' => undef, 'error' => 0, 'code' => '200', 'host' => undef, 'port' => undef, 'rcpt' => 'neko@example.org', 'message' => [ 'OK' ], 'command' => 'DATA' }, 'Haineko::SMTPD::Response' );
new( %arguments )
new() is a constructor of Haineko::SMTPD::Relay::Screen
new()
my $e = Haineko::SMTPD::Relay::Screen->new( 'attr' => { # Args for Email::MIME 'content_type' => 'text/plain' }, 'head' => { # Email header 'Subject' => 'Test', 'To' => 'neko@example.org', }, 'body' => 'Email message', # Email body 'mail' => 'kijitora@example.jp',# Envelope sender 'rcpt' => 'cat@example.org', # Envelope recipient );
sendmail
sendmail() will print an email to standard error device.
sendmail()
my $e = Haineko::SMTPD::Relay::Screen->new( %argvs ); print $e->sendmail; # Always 1 print Dumper $e->response; # Dumps Haineko::SMTPD::Response object
https://github.com/azumakuniyuki/Haineko
azumakuniyuki <perl.org [at] azumakuniyuki.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Haineko, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Haineko
CPAN shell
perl -MCPAN -e shell install Haineko
For more information on module installation, please visit the detailed CPAN module installation guide.