summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/class_email.php37
1 files changed, 36 insertions, 1 deletions
diff --git a/includes/class_email.php b/includes/class_email.php
index 685c194..5c8c4cc 100644
--- a/includes/class_email.php
+++ b/includes/class_email.php
@@ -192,7 +192,6 @@ class EMail
* mail() the email
*
* @return bool
- */
function send()
{
global $phpEx, $phpbb_root_path;
@@ -220,5 +219,41 @@ class EMail
return true;
}
+ */
+ function send()
+ {
+ global $phpEx, $phpbb_root_path;
+
+ if ( $this->address == null )
+ {
+ message_die('No email address set');
+ }
+
+ if ( !$this->parse_email() )
+ {
+ return false;
+ }
+
+ // Add date and encoding type
+ $universal_extra = "MIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . gmdate('D, d M Y H:i:s', time()) . " UT\n";
+ $this->extra_headers = $universal_extra . $this->extra_headers;
+
+// $result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers);
+ require_once "Mail.php";
+ $host = "localhost";
+ $port = "25";
+ $email_from = "Ancient Dominion DKP <eq@rebelhq.org>";
+ $email_address = "eq@rebelhq.org";
+
+ $headers = array ('From' => $email_from, 'To' => $this->address, 'Subject' => $this->subject, 'Reply-To' => $email_address);
+ $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => false));
+ $mail = $smtp->send($this->address, $headers, $this->msg);
+
+ if (PEAR::isError($mail)) {
+ message_die('Failed sending email');
+ }
+
+ return true;
+ }
}
?> \ No newline at end of file