Changeset 1818 for trunk/include/functions_mail.inc.php
- Timestamp:
- Feb 14, 2007, 11:53:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_mail.inc.php
r1809 r1818 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // | Copyright (C) 2006 Ruben ARNAUD - team@phpwebgallery.net|6 // | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net | 7 7 // +-----------------------------------------------------------------------+ 8 8 // | branch : BSF (Best So Far) … … 27 27 // +-----------------------------------------------------------------------+ 28 28 29 /**30 * - Extract mail fonctions of password.php31 * - Modify pwg_mail (add pararameters + news fonctionnalities)32 * - Var conf_mail, function get_mail_configuration, format_email, pwg_mail33 */34 35 29 // +-----------------------------------------------------------------------+ 36 30 // | functions | … … 100 94 101 95 /** 102 * Return an completed array template/theme96 * Returns an completed array template/theme 103 97 * completed with $conf['default_template'] 104 98 * … … 162 156 163 157 /** 158 * Returns email of all administrator 159 * 160 * @return string 161 */ 162 function get_administrators_email() 163 { 164 global $conf; 165 166 $result = array(); 167 168 $query = ' 169 select 170 U.'.$conf['user_fields']['username'].' as username, 171 U.'.$conf['user_fields']['email'].' as mail_address 172 from 173 '.USERS_TABLE.' as U, 174 '.USER_INFOS_TABLE.' as I 175 where 176 I.user_id = U.'.$conf['user_fields']['id'].' and 177 I.status in (\'webmaster\', \'admin\') and 178 '.$conf['user_fields']['email'].' is not null 179 order by 180 username 181 '; 182 183 $datas = pwg_query($query); 184 if (!empty($datas)) 185 { 186 while ($admin = mysql_fetch_array($datas)) 187 { 188 if (!empty($admin['mail_address'])) 189 { 190 array_push($result, format_email($admin['username'], $admin['mail_address'])); 191 } 192 } 193 } 194 195 return $result; 196 } 197 198 /** 164 199 * sends an email, using PhpWebGallery specific informations 165 200 * … … 168 203 * - args: function params of mail function: 169 204 * o from: sender [default value webmaster email] 205 * o Cc: array of carbon copy receivers of the mail. [default value empty] 206 * o Bcc: array of blind carbon copy receivers of the mail. [default value empty] 170 207 * o subject [default value 'PhpWebGallery'] 171 208 * o content: content of mail [default value ''] … … 175 212 * o theme: template to use [default $conf['default_template']] 176 213 */ 177 //function pwg_mail($to, $from = '', $subject = 'PhpWebGallery', $infos = '', $infos_format = 'text/plain', $email_format = null)178 214 function pwg_mail($to, $args = array()) 179 215 { … … 223 259 } 224 260 261 if ($conf_mail['send_bcc_mail_webmaster']) 262 { 263 $args['Bcc'][] = $conf_mail['formated_email_webmaster']; 264 } 265 225 266 if (($args['content_format'] == 'text/html') and ($args['email_format'] == 'text/plain')) 226 267 { … … 233 274 $headers = 'From: '.$args['from']."\n"; 234 275 $headers.= 'Reply-To: '.$args['from']."\n"; 276 277 if (!empty($args['Cc'])) 278 { 279 $headers.= 'Cc: '.implode(',', $args['Cc'])."\n"; 280 } 281 282 if (!empty($args['Bcc'])) 283 { 284 $headers.= 'Bcc: '.implode(',', $args['Bcc'])."\n"; 285 } 286 235 287 $headers.= 'Content-Type: multipart/alternative;'."\n"; 236 288 $headers.= ' boundary="---='.$conf_mail['boundary_key'].'";'."\n"; 237 289 $headers.= ' reply-type=original'."\n"; 238 290 $headers.= 'MIME-Version: 1.0'."\n"; 239 240 if ($conf_mail['send_bcc_mail_webmaster'])241 {242 $headers.= 'Bcc: '.$conf_mail['formated_email_webmaster']."\n";243 }244 291 245 292 $content = '';
Note: See TracChangeset
for help on using the changeset viewer.