1Email::Simple::Creator(U3s)er Contributed Perl DocumentatEimoanil::Simple::Creator(3)
2
3
4
6 Email::Simple::Creator - Email::Simple constructor for starting anew
7
9 use Email::Simple;
10 use Email::Simple::Creator;
11
12 my $email = Email::Simple->create(
13 header => [
14 From => 'casey@geeknest.com',
15 To => 'drain@example.com',
16 Subject => 'Message in a bottle',
17 ],
18 body => '...',
19 );
20
21 $email->header_set( 'X-Content-Container' => 'bottle/glass' );
22
23 print $email->as_string;
24
26 This software provides a constructor to Email::Simple for creating mes‐
27 sages from scratch.
28
30 create
31
32 my $email = Email::Simple->create(header => [ @headers ], body => '...');
33
34 This method is a constructor that creates an "Email::Simple" object
35 from a set of named parameters. The "header" parameter's value is a
36 list reference containing a set of headers to be created. The "body"
37 parameter's value is a scalar value holding the contents of the message
38 body.
39
40 If no "Date" header is specified, one will be provided for you based on
41 the "gmtime()" of the local machine. This is because the "Date" field
42 is a required header and is a pain in the neck to create manually for
43 every message. The "From" field is also a required header, but it is
44 not provided for you.
45
46 The parameters passed are used to create an email message that is
47 passed to "Email::Simple->new()". "create()" returns the value returned
48 by "new()". With skill, that's an "Email::Simple" object.
49
51 Email::Simple, perl.
52
54 Casey West, <casey@geeknest.com>.
55
57 Copyright (c) 2004 Casey West. All rights reserved.
58 This module is free software; you can redistribute it and/or modify it
59 under the same terms as Perl itself.
60
61
62
63perl v5.8.8 2007-02-23 Email::Simple::Creator(3)