Changeset 1120 in subversion


Ignore:
Timestamp:
Feb 19, 2008 6:59:38 PM (5 years ago)
Author:
thomasb
Message:

Allow to send mail with BCC recipients only + remove some unused vars

Location:
trunk/roundcubemail
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r1119 r1120  
    55---------- 
    66- Localize folder name in page title (#1484785) 
     7- Allow to send mail with BCC recipients only 
    78 
    892008/02/12 (estadtherr) 
  • trunk/roundcubemail/program/js/app.js

    r1098 r1120  
    16961696    // check input fields 
    16971697    var input_to = rcube_find_object('_to'); 
     1698    var input_cc = rcube_find_object('_cc'); 
     1699    var input_bcc = rcube_find_object('_bcc'); 
    16981700    var input_subject = rcube_find_object('_subject'); 
    16991701    var input_message = rcube_find_object('_message'); 
    17001702 
    17011703    // check for empty recipient 
    1702     if (input_to && !rcube_check_email(input_to.value.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true)) 
     1704    var recipients = input_to.value ? input_to.value : (input_cc.value ? input_cc.value : input_bcc.value); 
     1705    if (!rcube_check_email(recipients.replace(/^\s+/, '').replace(/[\s,;]+$/, ''), true)) 
    17031706      { 
    17041707      alert(this.get_label('norecipientwarning')); 
  • trunk/roundcubemail/program/steps/mail/sendmail.inc

    r1078 r1120  
    1111 | PURPOSE:                                                              | 
    1212 |   Compose a new mail message with all headers and attachments         | 
    13  |   and send it using IlohaMail's SMTP methods or with PHP mail()       | 
     13 |   and send it using the PEAR::Net_SMTP class or with PHP mail()       | 
    1414 |                                                                       | 
    1515 +-----------------------------------------------------------------------+ 
     
    130130 
    131131 
    132 if (!$savedraft && empty($_POST['_to']) && empty($_POST['_subject']) && $_POST['_message']) 
     132if (!$savedraft && empty($_POST['_to']) && empty($_POST['_cc']) && empty($_POST['_bcc']) && empty($_POST['_subject']) && $_POST['_message']) 
    133133  { 
    134134  $OUTPUT->show_message("sendingfailed", 'error'); 
     
    147147// replace new lines and strip ending ', ' 
    148148$mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset)); 
    149  
    150 // decode address strings 
    151 $to_address_arr = $IMAP->decode_address_list($mailto); 
     149$mailcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
     150$mailbcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
     151 
     152if (empty($mailto) && !empty($mailcc)) { 
     153  $mailto = $mailcc; 
     154  $mailcc = null; 
     155} 
     156else if (empty($mailto)) 
     157  $mailto = 'undisclosed-recipients:;'; 
     158 
     159// get sender name and address 
    152160$identity_arr = rcmail_get_identity(get_input_value('_from', RCUBE_INPUT_POST)); 
    153  
    154161$from = $identity_arr['mailto']; 
    155 $first_to = is_array($to_address_arr[0]) ? $to_address_arr[0]['mailto'] : $mailto; 
    156162 
    157163if (empty($identity_arr['string'])) 
     
    164170 
    165171// additional recipients 
    166 if (!empty($_POST['_cc'])) 
    167   $headers['Cc'] = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
    168  
    169 if (!empty($_POST['_bcc'])) 
    170   $headers['Bcc'] = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
     172if (!empty($mailcc)) 
     173  $headers['Cc'] = $mailcc; 
     174 
     175if (!empty($mailbcc)) 
     176  $headers['Bcc'] = $mailbcc; 
    171177   
    172178if (!empty($identity_arr['bcc'])) 
Note: See TracChangeset for help on using the changeset viewer.