-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.pl
26 lines (19 loc) · 810 Bytes
/
test.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use lib "lib";
use three4clavin::aws::ses;
main();
sub main {
my $awsSes = new three4clavin::aws::ses(
AWS_CREDENTIAL_FILE => "aws.creds"
);
#### Warning - sender must be "verified" by AWS utils outside of this
#### script, or you'll get nothing but errors back
my $awsSender = '[email protected]';
my $awsReceiver = '[email protected]';
my $emailParts = $awsSes->createNewParts();
my $filePart = $awsSes->addFilePart("email.png", "my-image.png", "image/png", $emailParts);
my $textPart = $awsSes->addTextPart("Hello World.", "us-ascii", $emailParts);
my $email = $awsSes->createEmail($emailParts, $awsSender, $awsReceiver, 'AWS SES Test');
$awsSes->sendEmail($email, $awsSender, $awsReceiver);
print "Email sent.\n";
}