1Email::Sender(3) User Contributed Perl Documentation Email::Sender(3)
2
3
4
6 Email::Sender - a library for sending email
7
9 version 2.500
10
12 my $message = Email::MIME->create( ... );
13 # produce an Email::Abstract compatible message object,
14 # e.g. produced by Email::Simple, Email::MIME, Email::Stuff
15
16 use Email::Sender::Simple qw(sendmail);
17 use Email::Sender::Transport::SMTP qw();
18 use Try::Tiny;
19
20 try {
21 sendmail(
22 $message,
23 {
24 from => $SMTP_ENVELOPE_FROM_ADDRESS,
25 transport => Email::Sender::Transport::SMTP->new({
26 host => $SMTP_HOSTNAME,
27 port => $SMTP_PORT,
28 })
29 }
30 );
31 } catch {
32 warn "sending failed: $_";
33 };
34
36 Email::Sender replaces the old and sometimes problematic Email::Send
37 library, which did a decent job at handling very simple email sending
38 tasks, but was not suitable for serious use, for a variety of reasons.
39
40 Most users will be able to use Email::Sender::Simple to send mail.
41 Users with more specific needs should look at the available
42 Email::Sender::Transport classes.
43
44 Documentation may be found in Email::Sender::Manual, and new users
45 should start with Email::Sender::Manual::QuickStart.
46
48 This library should run on perls released even a long time ago. It
49 should work on any version of perl released in the last five years.
50
51 Although it may work on older versions of perl, no guarantee is made
52 that the minimum required version will not be increased. The version
53 may be increased for any reason, and there is no promise that patches
54 will be accepted to lower the minimum required perl.
55
57 Email::Sender itself is a Moo role. Any class that implements
58 Email::Sender is required to provide a method called "send". This
59 method should accept any input that can be understood by
60 Email::Abstract, followed by a hashref containing "to" and "from"
61 arguments to be used as the envelope. The method should return an
62 Email::Sender::Success object on success or throw an
63 Email::Sender::Failure on failure.
64
66 Ricardo Signes <rjbs@semiotic.systems>
67
69 • Alex Efros <powerman@powerman.name>
70
71 • Aristotle Pagaltzis <pagaltzis@gmx.de>
72
73 • Bernhard Graf <augensalat@gmail.com>
74
75 • Christian Walde <walde.christian@googlemail.com>
76
77 • David Golden <dagolden@cpan.org>
78
79 • David Steinbrunner <dsteinbrunner@pobox.com>
80
81 • Hans Dieter Pearcey <hdp@cpan.org>
82
83 • HIROSE Masaaki <hirose31@gmail.com>
84
85 • James E Keenan <jkeenan@cpan.org>
86
87 • Justin Hunter <justin.d.hunter@gmail.com>
88
89 • Karen Etheridge <ether@cpan.org>
90
91 • Kenichi Ishigaki <ishigaki@cpan.org>
92
93 • kga <watrty@gmail.com>
94
95 • Kris Matthews <kris@tigerlms.com>
96
97 • Marc Bradshaw <marc@marcbradshaw.net>
98
99 • Stefan Hornburg (Racke) <racke@linuxia.de>
100
101 • William Blunn <zgpmax@cpan.org>
102
104 This software is copyright (c) 2021 by Ricardo Signes.
105
106 This is free software; you can redistribute it and/or modify it under
107 the same terms as the Perl 5 programming language system itself.
108
109
110
111perl v5.36.0 2022-07-22 Email::Sender(3)