subject = $context['subject']; $this->email = $context['email']; $this->attachment = $context['attachment']; $this->from = $context['from']; $this->from_name = $context['from_name']; $this->body = $context['body']; } public function send() { $subject = $this->subject; $emails = $this->email; $attachment = $this->attachment; $from = $this->from; $from_name = $this->from_name; $body = $this->body; // $email = "borykim@gmail.com"; $mailer = new PHPMailer(); $mailer->From = $from; $mailer->FromName = $from_name; if(!empty($attachment)) $mailer->AddAttachment($attachment); $mailer->isHTML(true); $mailer->Body = $body; $mailer->Subject = $subject; foreach($emails AS $email) $mailer->AddAddress($email); $status = true; if(!$mailer->Send()) $status = false; return $status; } } ?>