source: trunk/www/Base/Mail.php

Last change on this file was 93, checked in by chronos, 11 years ago
  • Fixed: System variable as parameter to constructors of descendents of Module class.
  • Removed: End PHP mark "?>" from all files.
File size: 921 bytes
Line 
1<?php
2
3class Mail
4{
5 var $Subject;
6 var $Content;
7 var $RecipientAddress;
8 var $RecipientName;
9 var $SenderAddress;
10 var $SenderName;
11 var $AdditionalHeaders;
12
13 function Send()
14 {
15 $this->AdditionalHeaders['To'] = $this->RecipientName.' <'.$this->RecipientAddress.'>';
16 $this->AdditionalHeaders['From'] = $this->SenderName.' <'.$this->SenderAddress.'>';
17 $this->AdditionalHeaders['MIME-Version'] = '1.0';
18 $this->AdditionalHeaders['Content-type'] = 'text/html; charset=UTF-8';
19 $Headers = '';
20 foreach($this->AdditionalHeaders as $Index => $Item)
21 {
22 $Headers .= $Index.': '.$this->EncodeBase64($Item)."\r\n";
23 }
24 $Subject = $this->EncodeBase64($this->Subject);
25 return(mail($this->RecipientAddress, $Subject, $this->Content, $Headers));
26 }
27
28 function EncodeBase64($Text)
29 {
30 return('=?UTF-8?B?'.base64_encode($this->Subject).'?=');
31 }
32}
Note: See TracBrowser for help on using the repository browser.