-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsesModelo.php
More file actions
42 lines (38 loc) · 1.05 KB
/
Copy pathsesModelo.php
File metadata and controls
42 lines (38 loc) · 1.05 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
//Load de sdk
require_once 'vendor/autoload.php';
use Aws\Common\Aws;
function sendMailSES($text, $html, $subject, $from, $to = array()) {
$text = utf8_decode($text);
$html = utf8_decode($html);
$subject = utf8_decode($subject);
try {
$client = Aws::factory( __DIR__ . '/configurationFile.php')->get('ses');
echo 'Se creo el cliente<br>';
$messageId = $client->sendEmail(array(
'Source' => $from,
'Destination' => array(
'ToAddresses' => $to
),
'Message' => array(
'Subject' => array(
'Data' => $subject
),
'Body' => array(
'Text' => array(
'Data' => $text
),
'Html' => array(
'Data' => $html
)
),
)
)
);
return true;
} catch (Exception $e) {
echo $e->getMessage();
return false;
}
}
?>