header_raw_prepend $email->header_raw_prepend($field => $value) This is another name (and the preferred one) for header_set. This is another name (and the preferred one) for header. If no values are given to set, the header will be removed from to the message entirely. If you pass multiple lines in, you get multiple headers, and order is retained. Sets the header to contain the given data. header_set $email->header_set($field, $line1, $line2. If second parameter is specified then instead first value it returns value at position $index (negative $index is from the end). In scalar context, it returns the first value for the named header. In list context, this returns every value for the named header.
My $first = $email->header($header_name) header my = $email->header($header_name) This method substitutes the given new header object for the email's existing header object. header_obj_set $email->header_obj_set($new_header_obj) For the interface for this object, see Email::Simple::Header. This method returns the object representing the email's header. header_obj my $header = $email->header_obj The From field is also a required header, but it is not provided for you. This is because the Date field is a required header and is a pain in the neck to create manually for every message. If no Date header is specified, one will be provided for you based on the gmtime of the local machine. Line endings in the body will normalized to CRLF. The body parameter's value is a scalar value holding the contents of the message body. The header parameter's value is a list reference containing a set of headers to be created. This method is a constructor that creates an Email::Simple object from a set of named parameters. The named module is not 'require'-ed by Email::Simple! create my $email = Email::Simple->create(header =>, body => '.') Valid arguments are: header_class - the class used to create new header objects If you want to create a message from scratch, you should use the "create" method. This can result in significant memory savings. $message may be a reference to a message string, in which case the string will be altered in place. This method parses an email from a scalar containing an RFC2822 formatted message and returns an object. METHODS new my $email = Email::Simple->new($message, \%arg) Email::* modules are meant to be simple to use and to maintain, pared to the bone, fast, minimal in their external dependencies, and correct. The Email:: namespace was begun as a reaction against the increasing complexity and bugginess of Perl's existing email modules. $email->header_set( 'X-Content-Container' => 'bottle/glass' ) $email->header_set("From", 'Simon Cozens ') My $from_header = $email->header("From") Version 2.216 SYNOPSIS use Email::Simple It is not a lot better, but hopefully the rewording can help you understand the rules.Email::Simple - simple parsing of RFC2822 message format and headers VERSION The right-most label must be all alphabetic.Labels must not start with a hyphen, end with a hyphen, or contain two successive hyphens.Labels must be less than 63 characters.If there is a \, any character except CR or LF is allowed.TEXT can contain alphabetic, numeric, and these symbols: !#$%'*+-/=?^_`, |, and ^ are not allowed unescaped.No periods can start or end the local part. Unquoted local parts can consist of TEXT, optionally separated by periods.The local part can be unquoted, quoted in its entirity, or quoted on a per-label basis.Email addresses consist of a local part, the symbol, and the domain.All email addresses are in 7-bit US ASCII.Oh my word! There are so many rules that regulate email addresses.