Exemple #1
0
 /**
  * 
  * @access public
  * @param id
  * 
  */
 public function sendAlert($id)
 {
     $mail = new mailer();
     $user = new users();
     // send alert email !
     $row = $user->getUser($id);
     $emailTo = $row['user'];
     $to[] = $emailTo;
     $subject = "Alert: Hours spent have exceeded planned hours";
     $mail->setSubject($subject);
     $text = "Hello " . $emailTo . ",\n\t\t\t\t\t\t\t\t\n\t\t\tThis is a friendly reminder that you have surpassed\n\t\t\t\t\t\t\t\t\n\t\t\tthe estimated hours for this project. While we \n\t\t\t\t\t\t\t\t\t\n\t\t\tunderstand it is impossible to meet every deadline\n\t\t\t\t\t\t\t\t\t\n\t\t\twe encourage you to be as diligent as possible with\n\t\t\t\t\t\t\t\t\t\n\t\t\tyour workload.";
     $mail->setText($text);
     $mail->sendMail($to);
 }
Exemple #2
0
        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
        print_r($this);
        die('There was an error in processing your request. Please contact us at XXX-XXX-XXXX for further assistance.');
    }
    protected function setHeaders()
    {
        $headers[] = "Content-type: text/plain; charset=iso-8859-1";
        $headers[] = "From: webmaster@example.com";
        $headers[] = "Reply-To: webmaster@example.com";
        $headers[] = "Subject: {$this->subject}";
        $headers[] = "X-Mailer: PHP/" . phpversion();
        $this->headers = implode('\\r\\n', $headers);
    }
    protected function setSubject()
    {
        $this->subject = $this->name . ' is interested in purchasing property!';
    }
    protected function setMessage()
    {
        $this->message = $this->name . ' heard about us recently from (' . $this->option . ')
                                        and would like to look into our services to purchase
                                        a home! They have a budget of $' . $this->budget . ' 
                                        and can be contacted at the following:
                                        ' . $this->address1 . ' 
                                        ' . $this->address2 . ' 
                                        ' . $this->city . ', ' . $this->state . ' ' . $this->zip;
    }
}
$mailer = new mailer();
$mailer->sendMail();