Email::Simple::Creator - build an Email::Simple object from scratch
use Email::Simple; use Email::Simple::Creator; my $email = Email::Simple->create( header => [ From => 'casey@geeknest.com', To => 'drain@example.com', Subject => 'Message in a bottle', ], body => '...', ); $email->header_set( 'X-Content-Container' => 'bottle/glass' ); print $email->as_string;
This software provides a constructor to Email::Simple for creating messages from scratch.
my $email = Email::Simple->create(header => [ @headers ], body => '...');
This method is a constructor that creates an Email::Simple object from a set of named parameters. The header parameter's value is a list reference containing a set of headers to be created. The body parameter's value is a scalar value holding the contents of the message body. Line endings in the body will normalized to CRLF.
header
body
If no Date header is specified, one will be provided for you based on the gmtime of the local machine. This is because the Date field is a required header and is a pain in the neck to create manually for every message. The From field is also a required header, but it is not provided for you.
Date
gmtime
From
This module is maintained by the Perl Email Project
http://emailproject.perl.org/wiki/Email::Simple::Creator
Casey West originally wrote Email::Simple::Creator in 2004. Ricardo SIGNES took over maintenance in 2006.
Copyright (c) 2004 Casey West.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Email::Simple::Creator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Email::Simple::Creator
CPAN shell
perl -MCPAN -e shell install Email::Simple::Creator
For more information on module installation, please visit the detailed CPAN module installation guide.