-
-
06 Jun 2018 15:49:40 UTC
- Distribution: Email-Simple
- Module version: 2.216
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (3)
- Testers (7032 / 0 / 0)
- Kwalitee
Bus factor: 1- 93.13% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity
24 month- Tools
- Download (38.76KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 10 contributors- Simon Cozens
- Casey West
- Ricardo SIGNES
-
Brian Cassidy
-
Christian Walde
-
Marc Bradshaw
-
Michael Stevens
-
Pali
-
Ronald F. Guilmette
-
William Yardley
NAME
Email::Simple::Header - the header of an Email::Simple message
VERSION
version 2.216
SYNOPSIS
my $email = Email::Simple->new($text); my $header = $email->header_obj; print $header->as_string;
DESCRIPTION
This method implements the headers of an Email::Simple object. It is a very minimal interface, and is mostly for private consumption at the moment.
METHODS
new
my $header = Email::Simple::Header->new($head, \%arg);
$head
is a string containing a valid email header, or a reference to such a string. If a reference is passed in, don't expect that it won't be altered.Valid arguments are:
crlf - the header's newline; defaults to CRLF
as_string
my $string = $header->as_string(\%arg);
This returns a stringified version of the header.
header_names
This method returns a list of the unique header names found in this header, in no particular order.
header_raw_pairs
my @pairs = $header->header_raw_pairs; my $first_name = $pairs[0]; my $first_value = $pairs[1];
This method returns a list of all the field/value pairs in the header, in the order that they appear in the header. (Remember: don't try assigning that to a hash. Some fields may appear more than once!)
header_pairs
header_pairs is another name for header_raw_pairs, which was the original name for the method and which you'll see most often. In general, though, it's better to be explicit and use header_raw_pairs. (In Email::MIME, header_str_pairs exists for letting the library do the header decoding for you.)
header_raw
my $first_value = $header->header_raw($field); my $nth_value = $header->header_raw($field, $index); my @all_values = $header->header_raw($field);
This method returns the value or values of the given header field. If the named field does not appear in the header, this method returns false.
header
This method just calls
header_raw
. It's the older name forheader_raw
, but it can be a problem because Email::MIME, a subclass of Email::Simple, makesheader
return the header's decoded value.header_raw_set
$header->header_raw_set($field => @values);
This method updates the value of the given header. Existing headers have their values set in place. Additional headers are added at the end. If no values are given to set, the header will be removed from to the message entirely.
header_set
header_set is another name for header_raw_set, which was the original name for the method and which you'll see most often. In general, though, it's better to be explicit and use header_raw_set. (In Email::MIME, header_str_set exists for letting the library do the header encoding for you.)
header_raw_prepend
$header->header_raw_prepend($field => $value);
This method adds a new instance of the name field as the first field in the header.
crlf
This method returns the newline string used in the header.
AUTHORS
Simon Cozens
Casey West
Ricardo SIGNES
COPYRIGHT AND LICENSE
This software is copyright (c) 2003 by Simon Cozens.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Email::Simple, copy and paste the appropriate command in to your terminal.
cpanm Email::Simple
perl -MCPAN -e shell install Email::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.