Changeset 1696
- Timestamp:
- 08/25/08 16:03:07 (3 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
admin/mail.php (modified) (2 diffs)
-
lib/class/ampachemail.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/mail.php
r1695 r1696 37 37 } 38 38 39 // Multi-byte Character Mail 40 if(function_exists('mb_language')) { 41 ini_set("mbstring.internal_encoding","UTF-8"); 42 mb_language("uni"); 43 } 44 39 45 $clients = AmpacheMail::get_users($_REQUEST['to']); 40 46 41 47 foreach ($clients as $client) { 42 $recipient .= $client['fullname'] ." <" . $client['email'] . ">, "; 48 if(function_exists('mb_encode_mimeheader')) { 49 $recipient .= mb_encode_mimeheader($client['fullname']) ." <" . $client['email'] . ">, "; 50 } else { 51 $recipient .= $client['fullname'] ." <" . $client['email'] . ">, "; 52 } 43 53 } 44 54 … … 48 58 // Set the vars on the object 49 59 AmpacheMail::$recipient = $recipient; 50 AmpacheMail::$from = $GLOBALS['user']->fullname."<".$GLOBALS['user']->email.">"; 51 AmpacheMail::$subject = scrub_in($_REQUEST['subject']); 52 AmpacheMail::$message = scrub_in($_REQUEST['message']); 60 if(function_exists('mb_encode_mimeheader')) { 61 $fullname = mb_encode_mimeheader($GLOBALS['user']->fullname); 62 } else { 63 $fullname = $GLOBALS['user']->fullname; 64 } 65 AmpacheMail::$to = $fullname . "<" . $GLOBALS['user']->email . ">"; 66 AmpacheMail::$from = $fullname . "<" . $GLOBALS['user']->email . ">"; 67 AmpacheMail::$subject = scrub_in($_REQUEST['subject']); 68 if(function_exists('mb_eregi_replace')) { 69 AmpacheMail::$message = mb_eregi_replace("\r\n", "\n", scrub_in($_REQUEST['message'])); 70 } else { 71 AmpacheMail::$message = scrub_in($_REQUEST['message']); 72 } 73 AmpacheMail::$additional_header = array(); 74 AmpacheMail::$additional_header[] = 'X-Ampache-Mailer: 0.0.1'; 75 if(function_exists('mb_send_mail')) { 76 AmpacheMail::$additional_header[] = 'Content-Type: text/plain; charset=UTF-8'; 77 AmpacheMail::$additional_header[] = 'Content-Transfer-Encoding: 8bit'; 78 } else { 79 AmpacheMail::$additional_header[] = 'Content-Type: text/plain; charset=us-ascii'; 80 AmpacheMail::$additional_header[] = 'Content-Transfer-Encoding: 7bit'; 81 } 82 AmpacheMail::$additional_header[] = "From: " . AmpacheMail::$from; 83 AmpacheMail::$additional_header[] = "Bcc: $recipient"; 84 AmpacheMail::$sender = $GLOBALS['user']->email; 85 53 86 AmpacheMail::send(); 54 87 -
trunk/lib/class/ampachemail.class.php
r1445 r1696 27 27 public static $from; 28 28 public static $subject; 29 public static $to; 30 public static $additional_header; 31 public static $sender; 29 32 30 33 /** … … 90 93 public static function send() { 91 94 92 mail(self::$from,self::$subject,self::$message,"From: " . self::$from . "\r\nBcc: " . self::$recipient . "\r\n"); 95 // Multi-byte Character Mail 96 if(function_exists('mb_send_mail')) { 97 mb_send_mail(self::$to, 98 self::$subject, 99 self::$message, 100 implode("\n", self::$additional_header), 101 '-f'.self::$sender); 102 } else { 103 mail(self::$to, 104 self::$subject, 105 self::$message, 106 implode("\r\n", $additional_header), 107 '-f'.self::$sender); 108 } 93 109 94 110 return true;
