- Timestamp:
- Sep 25, 2007, 11:52:00 PM (17 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/config_default.inc.php
r2104 r2106 285 285 // Value could be text/plain or text/html 286 286 $conf['default_email_format'] = 'text/html'; 287 288 // smtp configuration 289 // (work if fsockopen function is allowed for smtp port) 290 // smtp_host: smtp server host 291 // if null, regular mail function is used 292 // format: hoststring[:port] 293 // exemple: smtp.pwg.net:21 294 // smtp_user/smtp_password: user & password for smtp identication 295 $conf['smtp_host'] = ''; 296 $conf['smtp_user'] = ''; 297 $conf['smtp_password'] = ''; 298 287 299 288 300 // check_upgrade_feed: check if there are database upgrade required. Set to -
trunk/include/functions_mail.inc.php
r2059 r2106 47 47 'mail_options' => $conf['mail_options'], 48 48 'send_bcc_mail_webmaster' => $conf['send_bcc_mail_webmaster'], 49 'default_email_format' => $conf['default_email_format'] 49 'default_email_format' => $conf['default_email_format'], 50 'use_smtp' => !empty($conf['smtp_host']), 51 'smtp_host' => $conf['smtp_host'], 52 'smtp_user' => $conf['smtp_user'], 53 'smtp_password' => $conf['smtp_password'] 50 54 ); 51 55 … … 74 78 if ($conf['enabled_format_email']) 75 79 { 76 $cvt7b_name = '"'.addslashes(str_translate_to_ascii7bits($name)).'"'; 77 78 if (strpos($email, '<') === false) 79 { 80 return $cvt7b_name.' <'.$email.'>'; 80 // Spring cleaning 81 $cvt_name = trim(preg_replace('#[\n\r]+#s', '', $name)); 82 $cvt_email = trim(preg_replace('#[\n\r]+#s', '', $email)); 83 // Ascii convertion 84 $cvt_name = '"'.addslashes(str_translate_to_ascii7bits($cvt_name)).'"'; 85 86 if (strpos($cvt_email, '<') === false) 87 { 88 return $cvt_name.' <'.$cvt_email.'>'; 81 89 } 82 90 else 83 91 { 84 return $cvt 7b_name.$email;92 return $cvt_name.$cvt_email; 85 93 } 86 94 } 87 95 else 88 96 { 89 return $ email;97 return $cvt_email; 90 98 } 91 99 } … … 437 445 } 438 446 439 440 447 /* 441 448 * sends an email, using PhpWebGallery specific informations … … 499 506 $args['subject'] = 'PhpWebGallery'; 500 507 } 501 $cvt7b_subject = str_translate_to_ascii7bits($args['subject']); 508 // Spring cleaning 509 $cvt_subject = trim(preg_replace('#[\n\r]+#s', '', $args['subject'])); 510 // Ascii convertion 511 $cvt_subject = str_translate_to_ascii7bits($cvt_subject); 502 512 503 513 if (!isset($args['content'])) … … 545 555 $headers.= ' reply-type=original'."\n"; 546 556 $headers.= 'MIME-Version: 1.0'."\n"; 557 $headers.= 'X-Mailer: Piwigo Mailer'."\n"; 547 558 548 559 $content = ''; … … 674 685 }*/ 675 686 676 if ($conf_mail['mail_options']) 677 { 678 $options = '-f '.$conf_mail['email_webmaster']; 679 680 return mail($to, $cvt7b_subject, $content, $headers, $options); 687 if ($conf_mail['use_smtp']) 688 { 689 include_once( PHPWG_ROOT_PATH.'include/class_smtp_mail.inc.php' ); 690 $smtp_mail = new smtp_mail( 691 $conf_mail['smtp_host'], $conf_mail['smtp_user'], $conf_mail['smtp_password'], 692 $conf_mail['email_webmaster']); 693 return $smtp_mail->mail($to, $cvt_subject, $content, $headers); 681 694 } 682 695 else 683 696 { 684 return mail($to, $cvt7b_subject, $content, $headers); 697 if ($conf_mail['mail_options']) 698 { 699 $options = '-f '.$conf_mail['email_webmaster']; 700 return mail($to, $cvt_subject, $content, $headers, $options); 701 } 702 else 703 { 704 return mail($to, $cvt_subject, $content, $headers); 705 } 685 706 } 686 707 }
Note: See TracChangeset
for help on using the changeset viewer.