1Email::Simple(3)      User Contributed Perl Documentation     Email::Simple(3)
2
3
4

NAME

6       Email::Simple - Simple parsing of RFC2822 message format and headers
7

SYNOPSIS

9         my $email = Email::Simple->new($text);
10
11         my $from_header = $email->header("From");
12         my @received = $email->header("Received");
13
14         $email->header_set("From", 'Simon Cozens <simon@cpan.org>');
15
16         my $old_body = $email->body;
17         $email->body_set("Hello world\nSimon");
18
19         print $email->as_string;
20

DESCRIPTION

22       "Email::Simple" is the first deliverable of the "Perl Email Project."
23       The Email:: namespace was begun as a reaction against the increasing
24       complexity and bugginess of Perl's existing email modules.  "Email::*"
25       modules are meant to be simple to use and to maintain, pared to the
26       bone, fast, minimal in their external dependencies, and correct.
27

METHODS

29       new
30
31       Parse an email from a scalar containing an RFC2822 formatted message,
32       and return an object.
33
34       header_obj
35
36         my $header = $email->header_obj;
37
38       This method returns the object representing the email's header, and at
39       present exists primarily for internal consumption.
40
41       header_obj_set
42
43         $email->header_obj_set($new_header_obj);
44
45       This method substitutes the given new header object for the email's
46       existing header object.
47
48       header
49
50         my @values = $email->header($header_name);
51         my $first  = $email->header($header_name);
52
53       In list context, this returns every value for the named header.  In
54       scalar context, it returns the first value for the named header.
55
56       header_set
57
58           $email->header_set($field, $line1, $line2, ...);
59
60       Sets the header to contain the given data. If you pass multiple lines
61       in, you get multiple headers, and order is retained.
62
63       header_names
64
65           my @header_names = $email->header_names;
66
67       This method returns the list of header names currently in the email
68       object.  These names can be passed to the "header" method one-at-a-time
69       to get header values. You are guaranteed to get a set of headers that
70       are unique. You are not guaranteed to get the headers in any order at
71       all.
72
73       For backwards compatibility, this method can also be called as headers.
74
75       header_pairs
76
77         my @headers = $email->header_pairs;
78
79       This method returns a list of pairs describing the contents of the
80       header.  Every other value, starting with and including zeroth, is a
81       header name and the value following it is the header value.
82
83       body
84
85       Returns the body text of the mail.
86
87       body_set
88
89       Sets the body text of the mail.
90
91       as_string
92
93       Returns the mail as a string, reconstructing the headers.
94
95       crlf
96
97       This method returns the type of newline used in the email.  It is an
98       accessor only.
99

CAVEATS

101       Email::Simple handles only RFC2822 formatted messages.  This means you
102       cannot expect it to cope well as the only parser between you and the
103       outside world, say for example when writing a mail filter for invoca‐
104       tion from a .forward file (for this we recommend you use Email::Filter
105       anyway).  For more information on this issue please consult RT issue
106       2478, <http://rt.cpan.org/NoAuth/Bug.html?id=2478>.
107

PERL EMAIL PROJECT

109       This module is maintained by the Perl Email Project
110
111       <http://emailproject.perl.org/wiki/Email::Simple>
112

AUTHORS

114       Simon Cozens originally wrote Email::Simple in 2003.  Casey West took
115       over maintenance in 2004, and Ricardo SIGNES took over maintenance in
116       2006.
117
119       Copyright 2004 by Casey West
120
121       Copyright 2003 by Simon Cozens
122
123       This library is free software; you can redistribute it and/or modify it
124       under the same terms as Perl itself.
125
126
127
128perl v5.8.8                       2007-03-20                  Email::Simple(3)
Impressum