1Email::Sender(3) User Contributed Perl Documentation Email::Sender(3)
2
3
4
6 Email::Sender - a library for sending email
7
9 version 1.300035
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 Email::Sender itself is a Moo role. Any class that implements
49 Email::Sender is required to provide a method called "send". This
50 method should accept any input that can be understood by
51 Email::Abstract, followed by a hashref containing "to" and "from"
52 arguments to be used as the envelope. The method should return an
53 Email::Sender::Success object on success or throw an
54 Email::Sender::Failure on failure.
55
57 Ricardo Signes <rjbs@semiotic.systems>
58
60 • Alex Efros <powerman@powerman.name>
61
62 • Aristotle Pagaltzis <pagaltzis@gmx.de>
63
64 • Bernhard Graf <augensalat@gmail.com>
65
66 • Christian Walde <walde.christian@googlemail.com>
67
68 • David Golden <dagolden@cpan.org>
69
70 • David Steinbrunner <dsteinbrunner@pobox.com>
71
72 • Hans Dieter Pearcey <hdp@cpan.org>
73
74 • HIROSE Masaaki <hirose31@gmail.com>
75
76 • James E Keenan <jkeenan@cpan.org>
77
78 • Justin Hunter <justin.d.hunter@gmail.com>
79
80 • Karen Etheridge <ether@cpan.org>
81
82 • Kenichi Ishigaki <ishigaki@cpan.org>
83
84 • kga <watrty@gmail.com>
85
86 • Kris Matthews <kris@tigerlms.com>
87
88 • Stefan Hornburg (Racke) <racke@linuxia.de>
89
90 • William Blunn <zgpmax@cpan.org>
91
93 This software is copyright (c) 2020 by Ricardo Signes.
94
95 This is free software; you can redistribute it and/or modify it under
96 the same terms as the Perl 5 programming language system itself.
97
98
99
100perl v5.32.1 2021-01-27 Email::Sender(3)