Ejemplo n.º 1
0
 public function send()
 {
     $content = $this->do_replace($this->content);
     if (static::$sending_method == static::METHOD_SENDMAIL) {
         return mail(implode(',', $this->recipients['']), $this->do_replace($this->subject), $content);
     } else {
         if (static::$sending_method == static::METHOD_SES) {
             require_once root . '/library/aws.phar';
             $controller = new \Aws\Ses\SesClient(['version' => 'latest', 'profile' => _ini::get('aws', 'profile'), 'region' => _ini::get('aws', 'region', 'eu-west-1')]);
             return $controller->sendEmail(['Source' => _ini::get('email', 'from_address'), 'Destination' => ['ToAddresses' => $this->recipients[''], 'CcAddresses' => $this->recipients['cc'], 'BccAddresses' => $this->recipients['bcc']], 'Message' => ['Subject' => ['Data' => $this->subject, 'Charset' => 'UTF8'], 'Body' => ['Text' => ['Data' => '', 'Charset' => 'UTF8'], 'Html' => ['Data' => $content, 'Charset' => 'UTF8']]]]);
         }
     }
 }