SMTP.pm

filter: Statementstmt 100% 8 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 10 / 10 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« SMTP/Connection.pm ↑ Summary
1 package Net::Async::SMTP;
2 # ABSTRACT: SMTP support for IO::Async
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.002';
7  
8 =head1 NAME
9  
10 Net::Async::SMTP - email sending with IO::Async
11  
12 =head1 VERSION
13  
14 version 0.002
15  
16 =head1 SYNOPSIS
17  
18 #!/usr/bin/env perl
19 use strict;
20 use warnings;
21 use IO::Async::Loop;
22 use Net::Async::SMTP::Client;
23 use Email::Simple;
24 my $email = Email::Simple->create(
25 header => [
26 From => 'someone@example.com',
27 To => 'other@example.com',
28 Subject => 'NaSMTP test',
29 ],
30 attributes => {
31 encoding => "8bitmime",
32 charset => "UTF-8",
33 },
34 body_str => '... text ...',
35 );
36 my $loop = IO::Async::Loop->new;
37 $loop->add(
38 my $smtp = Net::Async::SMTP::Client->new(
39 domain => 'example.com',
40 )
41 );
42 $smtp->connected->then(sub {
43 $smtp->login(
44 user => '...',
45 pass => '...',
46 )
47 })->then(sub {
48 $smtp->send(
49 to => 'someone@example.com',
50 from => 'other@example.com',
51 data => $email->as_string,
52 )
53 })->get;
54  
55 =head1 DESCRIPTION
56  
57 Provides basic email sending capability for L<IO::Async>, using
58 the L<Protocol::SMTP> implementation.
59  
60 See L<Protocol::SMTP/DESCRIPTION> for a list of supported features
61 and usage instructions.
62  
63 This class does nothing - use L<Net::Async::SMTP::Client> for
64 sending email.
65  
66 =cut
67  
68 1 1;
69  
70 __END__
« SMTP/Connection.pm ↑ Summary