Amazon-SES
view release on metacpan or search on metacpan
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
lib/Amazon/SES.pm view on Meta::CPAN
Subject => 'Hello World from SES',
Body => "Hello World"
);
unless ( $r->is_success ) {
die "Could not deliver the message: " . $r->error_message;
}
printf("Sent successfully. MessageID: %s\n", $r->message_id);
######### sending attachments
my $msg = MIME::Entity->build();
my $r = $ses->send( $msg );
=head1 DESCRIPTION
Implements Amazon Web Services' Simple Email Service (SES). Sess L<http://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html> for details and to sign-up for the service. Forked from Net::AWS::SES, changed to use Moops and updated to support ...
=head1 GETTING STARTED
After you sign-up for AWS SES service you need to create an C<IAM> credentials and create an C<access_key> and a C<secret_key>, which you will be needing to interface with the SES. Do not forget to grant permission to your C<IAM> to use SES. Read L<h...
lib/Amazon/SES.pm view on Meta::CPAN
If the only argument is passed, it must be an instance of MIME::Entity. Example:
$msg = MIME::Entity->build(
from => '[your address]',
to => '[your recipient]',
subject => 'MIME msg from AWS SES',
data => "<h1>Hello world from AWS SES</h1>",
type => 'text/html'
);
$msg->attach(
Path => File::Spec->catfile( 't', 'image.gif' ),
Type => 'image/gif',
Encoding => 'base64'
);
$ses = Amazon::SES->new(....);
$r = $ses->send($msg);
unless ( $r->is_success ) {
die $r->error_message;
t/iam-role.t view on Meta::CPAN
Data => "<h1>Hello world from AWS SES</h1>",
Type => 'text/html'
);
##### ATTACHMENTS
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new(GET => 'https://www.flickr.com/photos/evapro/385650640/in/photolist-69489U-fyz13-iiy7D5-5Ja6Rm-A5yuY-57JMUp-9SZi1g-53zkrK-98NZL3-9vSoog-5zvBWg-4khc92-9yMddK-2hR4AE-A5zqy-7yrNCC-6iDNFS-jz9QM6-iVKeLo-fXRSo-e3uwEk-8j...
my $res = $ua->request($request);
ok($res->is_success, "Successfully downloaded cat photo");
$msg->attach(
Data => $res->content,
Type => $res->header('Content-Type'),
Encoding => 'base64'
);
$r = $ses->send($msg);
ok( $r->is_success,
$r->is_success ? "send_mime() success" : $r->error_message );
ok( $r->request_id, "Request id: " . $r->request_id );
ok( $r->result, "Result element found" );
ok( $r->message_id, "Message sent successfully" );
t/iam-role.t~ view on Meta::CPAN
Data => "<h1>Hello world from AWS SES</h1>",
Type => 'text/html'
);
##### ATTACHMENTS
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new(GET => 'https://www.flickr.com/photos/evapro/385650640/in/photolist-69489U-fyz13-iiy7D5-5Ja6Rm-A5yuY-57JMUp-9SZi1g-53zkrK-98NZL3-9vSoog-5zvBWg-4khc92-9yMddK-2hR4AE-A5zqy-7yrNCC-6iDNFS-jz9QM6-iVKeLo-fXRSo-e3uwEk-8j...
my $res = $ua->request($request);
ok($res->is_success, "Successfully downloaded cat photo");
$msg->attach(
Data => $res->content,
Type => $res->header('Content-Type'),
Encoding => 'base64'
);
$r = $ses->send($msg);
ok( $r->is_success,
$r->is_success ? "send_mime() success" : $r->error_message );
ok( $r->request_id, "Request id: " . $r->request_id );
ok( $r->result, "Result element found" );
ok( $r->message_id, "Message sent successfully" );
Data => "<h1>Hello world from AWS SES</h1>",
Type => 'text/html'
);
##### ATTACHMENTS
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new(GET => 'https://www.flickr.com/photos/evapro/385650640/in/photolist-69489U-fyz13-iiy7D5-5Ja6Rm-A5yuY-57JMUp-9SZi1g-53zkrK-98NZL3-9vSoog-5zvBWg-4khc92-9yMddK-2hR4AE-A5zqy-7yrNCC-6iDNFS-jz9QM6-iVKeLo-fXRSo-e3uwEk-8j...
my $res = $ua->request($request);
ok($res->is_success, "Successfully downloaded cat photo");
$msg->attach(
Data => $res->content,
Type => $res->header('Content-Type'),
Encoding => 'base64'
);
$r = $ses->send($msg);
ok( $r->is_success,
$r->is_success ? "send_mime() success" : $r->error_message );
ok( $r->request_id, "Request id: " . $r->request_id );
ok( $r->result, "Result element found" );
ok( $r->message_id, "Message sent successfully" );
( run in 0.924 second using v1.01-cache-2.11-cpan-e1769b4cff6 )