diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2021-05-29 01:23:22 +0200 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2021-05-29 02:13:19 +0200 |
commit | 581865e05b23a5cc20eb9bf1ad155d4114c14b42 (patch) | |
tree | eff46952d957a871ecf56795f671b4bc2e1eb001 /includes | |
parent | cfe1f01bea60817fdbd4e18b6f811945014ad1c5 (diff) |
downstream changes
Diffstat (limited to 'includes')
-rw-r--r-- | includes/class_email.php | 37 |
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 |