1Email::Sender::TransporUts:e:rTeCsotn(t3r)ibuted Perl DoEcmuamieln:t:aSteinodner::Transport::Test(3)
2
3
4
6 Email::Sender::Transport::Test - deliver mail in memory for testing
7
9 version 2.600
10
12 This transport is meant for testing email deliveries in memory. It
13 will store a record of any delivery made so that they can be inspected
14 afterward.
15
17 This library should run on perls released even a long time ago. It
18 should work on any version of perl released in the last five years.
19
20 Although it may work on older versions of perl, no guarantee is made
21 that the minimum required version will not be increased. The version
22 may be increased for any reason, and there is no promise that patches
23 will be accepted to lower the minimum required perl.
24
26 deliveries
27 By default, the Test transport will not allow partial success and will
28 always succeed. It can be made to fail predictably, however, if it is
29 extended and its "recipient_failure" or "delivery_failure" methods are
30 overridden. These methods are called as follows:
31
32 $self->delivery_failure($email, $envelope);
33
34 $self->recipient_failure($to);
35
36 If they return true, the sending will fail. If the transport was
37 created with a true "allow_partial_success" attribute, recipient
38 failures can cause partial success to be returned.
39
40 For more flexible failure modes, you can override more aggressively or
41 can use Email::Sender::Transport::Failable.
42
43 This attribute stores an arrayref of all the deliveries made via the
44 transport. The "clear_deliveries" method returns a list of them.
45
46 Each delivery is a hashref, in the following format:
47
48 {
49 email => $email,
50 envelope => $envelope,
51 successes => \@ok_rcpts,
52 failures => \@failures,
53 }
54
55 Both successful and failed deliveries are stored.
56
57 A number of methods related to this attribute are provided:
58
59 • delivery_count
60
61 • clear_deliveries
62
63 • shift_deliveries
64
66 Ricardo Signes <cpan@semiotic.systems>
67
69 This software is copyright (c) 2022 by Ricardo Signes.
70
71 This is free software; you can redistribute it and/or modify it under
72 the same terms as the Perl 5 programming language system itself.
73
74
75
76perl v5.38.0 2023-07-20 Email::Sender::Transport::Test(3)