Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // www.fduran.com
- // send mail with Amazon AWS SES without extra library
- // needs Pear: apt-get install php-pear
- <?php
- function mailSES($to, $subject, $body, $from)
- {
- include_once('Mail.php');
- $headers["From"] = $from;
- $headers["To"] = $to;
- $headers["Subject"] = $subject;
- $params["host"] = "ssl://email-smtp.us-east-1.amazonaws.com";
- $params["port"] = "465";
- $params["auth"] = true;
- $params["username"] = "";// NEED USERNAME
- $params["password"] = "";// NEED PASSWORD
- try
- {
- $mail_object =& Mail::factory("smtp", $params);
- $mail_res = $mail_object->send($to, $headers, $body);
- }
- catch (Exception $e)
- {
- echo("Error sending mail: " . $e->getMessage() . "\n");
- }
- return false;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement