summaryrefslogtreecommitdiff
path: root/utils/mail.php
diff options
context:
space:
mode:
authordeva <deva>2010-02-25 20:30:01 +0000
committerdeva <deva>2010-02-25 20:30:01 +0000
commita741351d5c91913f22255b8e9e5d4586c70735d6 (patch)
tree536338130df920e5851462b04fa13d42b6fc889f /utils/mail.php
parente84a854e54adf07d0bda64f8e3a4182940b44a97 (diff)
Split up some of the mailcode in order to be able to reuse it in the upcoming pressrelease module.
Diffstat (limited to 'utils/mail.php')
-rw-r--r--utils/mail.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/utils/mail.php b/utils/mail.php
new file mode 100644
index 0000000..866bad4
--- /dev/null
+++ b/utils/mail.php
@@ -0,0 +1,25 @@
+<?php /* -*- mode: php; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+
+class Email {
+ public $timestamp;
+ public $email;
+
+ public function Email($email, $timestamp)
+ {
+ $this->email = $email;
+ $this->timestamp = $timestamp;
+ }
+
+ public function send($subject, $message,
+ $sender, $replyto)
+ {
+ $headers = "From: " . $sender . "\r\n";
+ $headers .= "Reply-To: " . $replyto . "\r\n";
+ $headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
+ $headers .= "X-Mailer: PHP/" . phpversion();
+
+ return mail($this->email, $subject, $message, $headers);
+ }
+}
+
+?> \ No newline at end of file