#!/usr/bin/perl use strict; use warnings; use Email::Simple; use Email::Simple::Creator; use Email::Archive; my $email = Email::Simple->create( header => [ From => 'foo@example.com', To => 'drain@example.com', Subject => 'Message in a bottle', 'Message-ID' => 'helloworld', ], body => 'hello there!' ); my $e = Email::Archive->new(); $e->storage->db_connect('dbi:SQLite:dbname=test.db'); print "sending @{[$email->as_string]}\n"; $e->store($email); my $found = $e->retrieve('helloworld'); print $found->as_string;